ich habe eine Schaltfläche in einem Tabellenblatt eingebaut, der immer das selbe tun soll, nämlich ein weiteres Calc-Dokument öffnen, das funktioniert soweit auch ganz gut
Code: Alles auswählen
Sub oeffne_EDV_orga
Dim oDoc as Object
Dim Filepath as String
Dim DirPath as String
Dim DirPath_1 as String
Dim OpenFile as String
Dim ButtonName as String
GlobalScope.BasicLibraries.LoadLibrary("Tools")
odoc = thiscomponent
check = odoc.haslocation()
if check = true then 'Prüfen ob die Datei einen Dateinamen hat
Filepath = oDoc.URL
DirPath = convertfromURL(Filepath)
DirPath_1 = DirectoryNameoutofPath(DirPath,GetPathSeparator())
ButtonName = ActiveSheet.Shapes(Application.Caller).DrawingObject.Characters.Text
MsgBox ButtonName
Dim NewWorkbook as Object
Dim NoArgs()
OpenFile = ConvertToURL(DirPath_1 & "//Dateilisten/edv_orga.ods")
MsgBox Filepath & CHR(13) & CHR(13) & DirPath & CHR(13)& CHR(13) & DirPath_1 & CHR(13) & CHR(13) & OpenFile
NewWorkbook = StarDesktop.loadComponentFromURL(OpenFile,"_blank",0 ,NoArgs())
else MsgBox "Das Dokument hat noch keinen Dateinamen!"
end if
End Sub
Ich hoffe jemand kann mir weiterhelfen
Grüße holdrio76