Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Help - Script to export a Graphic (Pivot Table) automatically

Hello,

Is there any script to export an specific Graphic (Pivot Table) in a specified workspace?

Thanks!

Dom

1 Solution

Accepted Solutions
chematos
Specialist II
Specialist II

Sorry, is CopyTableToClipboard True

You need to Allow Local Security to run macros

View solution in original post

11 Replies
Not applicable
Author

you mean

how to export object (for example pivot table) to Excel via Macro and save file to specific directory?

Not applicable
Author

Yes!

The dashboard I'm bulding will get data from one sorce, traeat in in form of a  pivot table, export it to a new table, then load this new table and use it with other sources... it's kinda messy, Iknow.

There's a way to do this?

Thanks!

chematos
Specialist II
Specialist II

Try something like this:

sub ExportExcel

Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = True
objExcel.Workbooks.Add

ActiveDocument.GetSheetObject("CH01").CopyTable True

objExcel.ActiveSheet.Paste

objExcel.Export 'C:/path'

end sub

Not applicable
Author

I can't make it work... I changed the path* inserted the code on "Main" script and put a CALL function right after it... nothing happens.

I tought it was b/c the script wasn't understanding the end of the function, so I put a ; befoe end sub. Nothing happens.

Any idea what I'm might be doing wrong?

*Path: C:\Users\re09083g\Desktop\EOG Qlikview_12-12\test.xls

chematos
Specialist II
Specialist II

Hi,

you have to do the macro in the Module Editor and change the path and the Obejct ID CH01 by your object ID.

Try this and let me know,

regards

Not applicable
Author

Ops... now it makes a lot more sense, but I get the error below when I hit the "Test" button:
"O objeto não dá suporte para a propriedade ou método: 'ActiveDocument.GetSheetObject(...).CopyTable' " (something like: Object dosn't support proprety or method "ActiveDocument.GetSheetObject(...) Copy Table)
I'm using QV11, Excel 2010. Already put "Requested Module Security" and "Current Local Security" to allow System Acccess.
Any ideas?
chematos
Specialist II
Specialist II

Sorry, is CopyTableToClipboard True

You need to Allow Local Security to run macros

Not applicable
Author

No support to .Export... also tried SaveAs with he same effect; even tought Save works but it its kind'a pointless to macro.

chematos
Specialist II
Specialist II

Look at User Poperties, Security menu, one of that options have to allow access to filesystem, also look at your user provileges of the folder you want to use to export