Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Exporting object to Excel... without Excel

Hi Guys,

To generate xls from some of my objects I'm using macros found on threads:

Re: Re: Macros guides, documents useful to codding?

These macros do work great, but now I need to modify one thing here: these macros use CreateObject("Excel.Application") that starts Excel when Excel is present on that machine. But since Qlik is able to export any object to xls without having Excel on that machine, is there a way to use some other command than CreateObject("Excel.Application") and export object to xls using some internal Qlik function?

I'm just wondering if there is a way to actually write object to xls file, not running Excel with particular object.

Thanks in advance for any answer.


Best regards,
Pawel

1 Solution

Accepted Solutions
fkeuroglian
Partner - Master
Partner - Master

Try this

this will export xls not using the Create Object Excel

Path = "C:\TEST.xls" 

set obj = ActiveDocument.GetSheetObject("CH685") 

obj.ExportBiff Path

Good Luck

Fernando

View solution in original post

5 Replies
fkeuroglian
Partner - Master
Partner - Master

Try this

this will export xls not using the Create Object Excel

Path = "C:\TEST.xls" 

set obj = ActiveDocument.GetSheetObject("CH685") 

obj.ExportBiff Path

Good Luck

Fernando

Not applicable
Author

Hi Fernando,

This works very well. Is there a possibility to target particular books in Excel file?


Regards,
Pawel

fkeuroglian
Partner - Master
Partner - Master

Hi, Pawel , great to hear that work ok!

what do you want to say to target particular books in excel? please explain a little more

Not applicable
Author

Hi Fernando,

I needed to create one Excel file with few Qlik objects exported to separate books in this file. I found a macro that does what I needed - details here:

http://community.qlik.com/message/566889#566889

But it wasn't good for me, because my objects were too complex and took too much time to get calculated, so Excel had timeouts waiting for data from Qlik. So I took different approach, I exported all objects to separate files using code you've provided, then I merged these files into one using VBA in Excel.

When I asked about targeting I just wondered if it is possible to add another book to existing file, by writing data to that file specifying the name of new book in it.

Best regards,

Pawel

fkeuroglian
Partner - Master
Partner - Master

Pawel, you can add a new excel page using:

set XLDoc = XLApp.Workbooks.Add


see this link, hope this helps!


Fernando


Create Excel Files via Macro on QlikView Server