Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

migle_purzelyte
New Contributor

Macro: Export as xlsx

Hello,

I wonder what is VBScript function to export table as xlsx in Qlikview November 2017.

For xls I was using ExportBiff but I cannot find what to use for xlsx.

Thanks in advance,

Migle

17 Replies
YoussefBelloum
Esteemed Contributor

Re: Macro: Export as xlsx

Hi,

if i'm not wrong, you can only export on xlsx with the latest release..

mto‌ maybe can confirm this ?

Employee
Employee

Re: Macro: Export as xlsx

Hi Migle / Youssef - I don't have this setup - but I believe it is the same - just now supports .xlsx - in the past - it would create a .xlsx - but there would be an error opening the file. Can you give it a try using the extension .xlsx and let us know?

Thanks

When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads as HELPFUL if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads as HELPFUL if you feel additional info is useful to others.

Regards,

Michael Tarallo (@mtarallo) | Twitter

Qlik

Regards,
Mike Tarallo
Qlik
migle_purzelyte
New Contributor

Re: Macro: Export as xlsx

Using ExportBiff with xlsx extension creates invalid file.

gardenierbi
Contributor

Re: Macro: Export as xlsx

Hi migle.purzelyte,

Did you find a solution for this?

Highlighted
migle_purzelyte
New Contributor

Re: Macro: Export as xlsx

Unfortunately still no

Miglė Purželytė

Business IQ

gardenierbi
Contributor

Re: Macro: Export as xlsx

Hi mto‌,

but I believe it is the same - just now supports .xlsx - in the past - it would create a .xlsx - but there would be an error opening the file. Can you give it a try using the extension .xlsx and let us know?


The ExportBiff function still generates a document with the old .XLS format. I get the same result as migle.purzelyte‌. Is there maybe a new function available in the API to get the new .XLSX format as output?


We appreciate your help for this. We aren't the only one with this question.


Regards,

Sander

petercappelle
New Contributor III

Re: Macro: Export as xlsx

Hi Everyone,

This is how I do the export to xlsx in QV (november release).

sub Export

set obj = ActiveDocument.GetSheetObject("CH1")

set objExcel = CreateObject("Excel.Application")

objExcel.Visible = False

objExcel.Workbooks.Add

Set ASheet = objExcel.ActiveSheet

ASheet.Application.DisplayAlerts = False

ASheet.Range("A1").Select

obj.CopyTableToClipboard true

ASheet.Paste

ASheet.SaveAs "c:\test.xlsx"

objExcel.Quit

end sub

gardenierbi
Contributor

Re: Macro: Export as xlsx

This will only work if MS Excel is installed on your machine. On most Qlik servers this isn't the case.

nihalbuddy09
Contributor II

Re: Macro: Export as xlsx

Hi Peter,

Thank you for posting the macro which I am going to use to export the data into .xlsx file format. But in my requirement while saving the file I need the today's date and timestamp along with the file name.

I have to run the macro multiple times in a day so that I will have a new file every time, can you please help me out how to pass the date and timestamp in this macro.


example file names:

Account_A1_2018-09-23_05-30-05.xlsx

Account_A1_2018-09-23_15-20-15.xlsx


Thanks,

Nihal


Community Browser