Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

obj.ExportEx path from variable

Trying to build a sub that exports a chart to an Excel file, where the user can choose the name and path to said file.

I have the following code (VBScript):

sub ExportToExcel()

                dfltWy = ActiveDocument.Variables("Default_Path").GetContent.String

                    dfltNm = ActiveDocument.Variables("Default_FileName").GetContent.String

                           pthWy =inputBox("Choose Path",,dfltWy)

                            flNm = inputBox("Choose Name",,dfltNm)

                     ActiveDocument.Variables("Path").SetContent pthWy, true

                     ActiveDocument.Variables("File_Name").SetContent flNm, true

                     expPth = chr(34)&pthWy&flNm&chr(34)

                     MsgBox(expPth)

                            set obj = ActiveDocument.GetSheetObject("CH07")

                     obj.ExportEx  expPth, 5           'it works fine 'til here. The MsgBox displays the correct path "C:\User\QlikView\Project\Default.xls"

                                                                           '(including quotations), but no file is created.

        '            obj.ExportEx  "C:\User\QlikView\Project\Default.xls", 5      ' <-<-<- this works as a check 

end sub

Any ideas on how I can get the obj.ExportEx to export according to the expPt variable?

1 Reply
Not applicable
Author

Solved it by switching tactics. Ended up with something similar to [the end of] Jacob Berglund's solution on:

http://qlikcommunity.qliktech.com/thread/7593

Would still be interested in whether it is possible to use obj.ExportEx for this...