Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
punitpopli
Specialist
Specialist

Store table data loaded in script into .xls/.xlsx

Hi Experts,

May I know if we can store the table loaded in QliKView script into .xls or .xlsx file?

Have gone through few posts, but didnt find the solution for the same.

Can anyone please help me in here?

Thanks in advance

Regards,

Punit

5 Replies
punitpopli
Specialist
Specialist
Author

I think we can use this macro,but need to know if we can get tableName instead of ObjectID.


Sub BasicExportToExcel

DIM ExcelApplication, ExcelWorkbook

SET ExcelApplication = CREATEOBJECT("Excel.Application")

SET ExcelWorkbook = ExcelApplication.Workbooks.Add

ActiveDocument.GetSheetObject("TB01").CopyTableToClipBoard TRUE

ExcelWorkbook.Worksheets(1).Paste

ExcelApplication.DisplayAlerts = FALSE

ExcelWorkbook.SaveAs "C:\BuffaloBI - Post Content\Qlikview\Export Excel\test.xls", 56

ExcelApplication.Quit

MsgBox "Export Complete"

End Sub

If we can get table Name then the Macro can be used for exporting the data to required format from the script.

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

No, this macro would not work from script. The ActiveDocument handle is not available from script.   The only idea I can think of is to store it in csv format (txt) and call some batch converter on the file. Google "csv to excel command line" and you'll see lot's of options ranging from free to low cost.

-Rob

punitpopli
Specialist
Specialist
Author

Thank you rwunderlich‌ for you reply, will work on the approach.

Regards,

Punit

tomasz_tru
Specialist
Specialist

Set extension of your CSV file to .xls and Excel should open it. SAP used this advanced technology for export

punitpopli
Specialist
Specialist
Author

Thanks for your reply, will work on the proposed solution.