Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
sunny_talwar

Export to Excel Macro

Hi Qlikers

I am in a need for a macro which would be linked to a button action to export a particular table box object into a Excel file. I have seen many Macros on the community, but I am finding it hard to configure them for my need. I was wondering if somebody can provide a working sample of a macro which does the above mentioned thing.

Thanks in advance for your support.

Best,

Sunny

18 Replies
buzzy996
Master II
Master II

hope so,let me try.

sunny_talwar
Author

Thanks Shiva

Colin-Albert
Partner - Champion
Partner - Champion

I would take care in exporting from a table box, as unless you include a unique key against each row of data, a table box will only export the unique data values. So if your data has any duplicates, the table box will contain a single row for the duplicates not all rows.


sunny_talwar
Author

Thanks for your response Colin Albert‌.

The users have been exporting the data from table box, the problem is that it has become too large for a desktop computer to handle is that, I thought that if they want to export it out, a macro might prove useful. But the macro that  Alexandros17 provided, somewhat does the job, but still takes a lot of time to do.

I am thinking of taking an alternate route where I only display the table box after a certain number of selections has been made.

Let me know if you or anyone else have other ideas.

Best,

Sunny

sunny_talwar
Author

Thanks guys for your input. I ended up using a calculation condition where I restricted the number of line items by 1,048,576 (which is the number of rows of data allowed to exported into a Excel). It seems to work for me and I think users will understand why I was required to do what I did.

Best,

Sunny

Colin-Albert
Partner - Champion
Partner - Champion

Hi sunindia.

You can configure the error messages on your chart to be more helpful to the users. When I add a row limit, I change the error message for "Calculation Condition Unfulfilled" to something like

     ='Please filter the data to select fewer than ' & $(vRowLimit) & ' rows to view this chart

     You currently have ' &  num(count(data_field_name), '#,##0') & ' rows selected'

The only drawback this can have is that the message font size cannot differ from the chart font size, so sometimes it is better to use a text box, with a conditional show, that overlays the chart to display this message, in addition to the calculation condition on the original chart.

rubenmarin

Hi Sunny, the example of exportbiff for a tablebox is very simple, I would say it's too much easy.

I read you touched the row-limit in Excel, maybe using csv you can avoid the limit.

For more customizations while exporting the excel I usually create a macro in Excel with the actions I want to do in my QV-Macro, then I use the code created in Excel as a base code to develop the macro.

sunny_talwar
Author

Hey RubenMarinthanks for your input.

Problem is I have very limited expertise with Excel Macros or QV Macros (I wish I paid more attention to them while in school), so it would be hard for me to implement.

Second issue with the Macro is that it won't allow the user to export from the portal, so I guess there is no point creating this Macro as half the users are going to view this application from the portal (as they only have viewer license)

Best,

Sunny

Colin-Albert
Partner - Champion
Partner - Champion

This post has a good overview of the issues of macros with the Access Point.

Macros are Bad