Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Macro problem

Hi

I have problem with macro. I want to open OpenOffice sheet, but my macro don't work. When I push the button, then opens my macro code in black.

Macro code:

Sub prooviks
Dim oSM
Dim oDesk
Dim oDoc
Dim aNoArgs()

Set oSM = CreateObject("com.sun.star.ServiceManager")
Set oDesk=oSM.createInstance("com.sun.star.frame.Desktop")
Set oDoc = oDesk.loadComponentFromURL("private:factory/scalc", "_blank", 0, aNoArgs)

End Sub


OpenOffice Basic will work with code like this:

Sub proov
Dim oSM
Dim oDesk, oDoc as Object
Dim aNoArgs()


Set oDesk=createUNOService("com.sun.star.frame.Desktop")
Set oDoc=oDesk.loadComponentFromURL("private:factory/scalc","_blank",0,aNoArgs())

End Sub

Can somebody help me, I'm new in QlikView and in OpenOffice too. Thanks!

1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

You will have to allow System Access for this macro. It's required for the CreateObject() call.

To allow system access, change the "Requested Module Security" and "Current Local Security" in the lower left corner of the macro editor window.

-Rob

View solution in original post

2 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

You will have to allow System Access for this macro. It's required for the CreateObject() call.

To allow system access, change the "Requested Module Security" and "Current Local Security" in the lower left corner of the macro editor window.

-Rob

Not applicable
Author

Thanks! ´Its working now!