Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikWorld 2020: Join us May 11 - 14, 2020 in Phoenix, AZ. Register early and save $400. Learn More
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
Valued Contributor II

Re: Help - Scrot to export a Graphic (Pivot Table)

Sorry, is CopyTableToClipboard True

You need to Allow Local Security to run macros

View solution in original post

11 Replies
Not applicable

Re: Help - Scrot to export a Graphic (Pivot Table)

you mean

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

Not applicable

Re: Help - Scrot to export a Graphic (Pivot Table)

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!

Highlighted
chematos
Valued Contributor II

Re: Help - Scrot to export a Graphic (Pivot Table)

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

Re: Help - Scrot to export a Graphic (Pivot Table)

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
Valued Contributor II

Re: Help - Scrot to export a Graphic (Pivot Table)

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

Re: Help - Scrot to export a Graphic (Pivot Table)

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
Valued Contributor II

Re: Help - Scrot to export a Graphic (Pivot Table)

Sorry, is CopyTableToClipboard True

You need to Allow Local Security to run macros

View solution in original post

Not applicable

Re: Help - Scrot to export a Graphic (Pivot Table)

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

chematos
Valued Contributor II

Re: Help - Scrot to export a Graphic (Pivot Table)

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