
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Export to Excel via macro-number format
Hi All,
I have a macro that exports a straight table to excel but once exported, the number format is ignored. Is there extra code i need to add into the macro to force a full number format?
Attached is a portion of the macro that I'm sure extra code needs to be inserted into.
Thank you in advance
- Tags:
- new_to_qlikview
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Ayron,
In the macro script it has to be something like
XLDoc.WorkSheets("Sheet1").Range("A:B").NumberFormatLocal = "#.##0"
decimal "#.##0,00"
percentage "#.##0,00%"
Regards
Vicky


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
To export the ST table to excel. Why don't you try simple code as per API guide.
Eg:
set obj = ActiveDocument.GetSheetObject("CH01")
obj.ExportBiff "C:\test.xls"
Hope it helps you
Cheers!!
Jagan

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Jagan,
The exporting is working fine. I am having an issue with number formatting. When the report is expoted to excel, the comma seperators and decimals are lost. I need to force format within the Macro script but I am unsure how.
Regards,
Ayron


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Change your dimension as =num(F2, '#,##0.##', '.' , ',' ) . Please find the attached file for your reference.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Still not working. It looks like it has to be forced withing the macro script. Just need to correct code.


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Have you seen my qvw file? Otherwise please provide sample qvw file.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Ayron,
In the macro script it has to be something like
XLDoc.WorkSheets("Sheet1").Range("A:B").NumberFormatLocal = "#.##0"
decimal "#.##0,00"
percentage "#.##0,00%"
Regards
Vicky

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you very much Vicky! Solved my problem. Works perfectly!!
Regards,
Ayron

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi All,
Using this macro we can send data to excel. But is it possible to add dropdown of filter in the exported excel using macro?
- Yojas
