There is no problem to open a calc sheet but when I try to print it I get following error:
Basic run-time error
An exception occured
Type: com.sun.star.lang.IllegalArgumentException
Message: cannot coerce argument type during coreflection call!
Tested to ways, neither working:
Code: Select all
Sub TestFunktion (Event as object)
Dim printopts as object
dim dispatcher as object
Dim oHidden(0) As New com.sun.star.beans.PropertyValue
oHidden(0).Name = "Hidden"
oHidden(0).Value = FALSE
oDBDoc = StarDesktop.loadComponentFromURL("file:///home/prm/Affarssystem/Exempel/TestKalkyl.ods", "_blank", 0, oHidden())
REM First test - not working
'oDBDoc.print(printopts)
REM Second test - not working either
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
dispatcher.executeDispatch(oDBDoc, ".uno:PrintDefault", "", 0, Array())
xray oDBDoc
msgbox " "
'oDBDoc.dispose()
end sub