Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
This is a very simple export:
SUB EXPORT
set sObject1 = ActiveDocument.GetSheetObject("CH_EXPORT")
sObject1.Export "E:\MyDoc.csv", ", "
end sub
CH_EXPORT is the name of the object containing the data (Your table)
Hi Sunny, Alessandro answer is correct (as usual ). If you want more documentation there is an app with useful help about automation: QlikView Core COM API Guide - Version 11
There is actually (at least) three more API-functions to do export:
ExportBIFF
ExportEx
ServerSideExportEx
Which gives you a selection of more paramters and file-formats....
Thanks for a very quick response Alessandro Saccone. What if I want to open the data in Excel instead of saving it? This way I can let the user save it wherever they like it to be saved.
My another question is, will this button (with macro action) will work on the portal version or will this only work on the desktop version of the application?
Best,
Sunny
I have looked at that qvw document, but somehow the only macro related to Export Excel I found seemed very complicated and it did not work for me. But thanks for sharing that information Ruben Marin
Best,
Sunny
Thanks for your response Petter Skjolden, Is there any place I can see examples of them being implemented? I need the macro to open the excel file instead of saving it in pre-defined location. Is that possible? and will the macro work on the portal as well?
Best,
Sunny
If you use the ServerSideExportEx it will be stored on the server as the API-function name implies. Then the location you store it to has to be a location that can be reached with a URL. That should be easy to configure or setup.
I am not sure if it is possible in the very same Macro to launch the URL though.
see attached in sheet1 export button..u have to modify a bit accordingly ur needs..but it won't work on access point,hopes helpful.
No the image Shiva, need to export out the data from a table box. Can the macro be edited to do that?