supportsService nicht gefunden
Verfasst: Fr, 17.06.2011 18:37
Ahoi,
ich habe unter Calc folgendes Makro eingebaut:
Damit soll das Datum der letzten Änderung angezeigt werden. Was auch passiert. Zumindest bis ich das Dokument wieder öffne. Dann bekomme ich folgende Fehlermeldung:
Das Ersetzen von
durch
hat nichts gebracht. OpenOffice gab die Meldung aus, dass oDoc null und ich hatte nur ein formschönes n/a statt des Datums.
Hat hier jemand eine Ahnung was da schief läuft?
ich habe unter Calc folgendes Makro eingebaut:
Code: Alles auswählen
Function CalcDoc_Modification_Date()
sTemp = "n/a"
oDoc = thisComponent
If IsNull( oDoc ) THEN
CalcDoc_Modification_Date() = sTemp
msgbox "oDoc null"
Exit Function
End If
If IsEmpty( oDoc ) THEN
CalcDoc_Modification_Date() = sTemp
msgbox "oDoc empty"
Exit Function
End If
' da hier als Calc-Funktion ("cf_")genutzt:
' Abfrage des Dokumententyps
If oDoc.supportsService("com.sun.star.sheet.SpreadsheetDocument" ) Then
' neue Eigenschaft ab OOo 3.0.0
cf_oDAT = oDoc.DocumentProperties.ModificationDate
' work with DocInfo
If IsEmpty( cf_oDAT ) Then
sTemp = "n/a"
else
With cf_oDAT
' set return format
' force month and day to two digits
sTemp = _
Format( .Day, "0#" ) & "." & _
Format( .Month, "0#" ) & "." & _
.Year
End With
End If 'gefülltes Objekt
' assign func return value
CalcDoc_Modification_Date = sTemp
End If ' check DOK
End Function
Code: Alles auswählen
BASIC-Laufzeitfehler Eigenschaft oder Methode nicht gefunden: supportsService.
Code: Alles auswählen
oDoc = thisComponent
Code: Alles auswählen
oDoc = StarDesktop.CurrentComponent
Hat hier jemand eine Ahnung was da schief läuft?