1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
| option explicit
'----------Ouverture du fichier source au format.CSV
Sub OuvrirGLPI
Dim Wchemin as string, sFilter as string, bHidden as boolean
', sFilter as String, bHidden as Boolean
Dim odocTAP as object, wDossierProg as string, wEntite as string
Dim odocMacro as object,ofeuilsMacro as object, ofeuilMacro as object,ocellMacro as object
odocMacro=ThisComponent
ofeuilsMacro=odocMacro.sheets
ofeuilMacro=ofeuilsMacro.getbyname("Feuille1")
ocellMacro=ofeuilMacro.getcellrangebyname("B3")
wDossierProg=ocellMacro.string
ocellMacro=ofeuilMacro.getcellrangebyname("B4")
wEntite=ocellMacro.string
wChemin=convertToURL(wDossierProg & wentite & ".csv")
Dim aProps(2) As New com.sun.star.beans.PropertyValue
aProps(0).Name = "FilterName"
aProps(0).Value = "Text - txt - csv (StarCalc)"
aProps(1).Name = "FilterOptions"
aProps(1).Value = sFilter
aProps(2).Name = "Hidden"
aProps(2).Value = bHidden
If not FileExists(wchemin) then
msgbox "Le document " & wchemin & " n'existe pas"
exit sub
end if
's'il est déjà ouvert, le réouvre en lecture seule
odocTAP=stardesktop.loadComponentFromURL(wchemin, "_Blank",0, aProps())
End Sub |
Partager