1

I am trying to export few charts to Excel (.Xlsx format) through Qlikview Macro and to save it on postrelaod at a particular location. The file works perfectly fine when it is run manually or from the batch (.bat) on double click.

But when scheduled to run from the Qlikview Management Console through the external File(.bat file) its generating the Excel Extract but the file is blank. The error is:

Error: Paste method of Worksheet class failed

I have checked the permission/location of the file and its not an issue.

James Z
  • 12,209
  • 10
  • 24
  • 44

1 Answers1

0

Postreload trigger saving charts via macro will not work via QMC (both postreload and frontend/chart manipulations doesn't work via QMC).

To solve that I do as following.

1) Set reload in QMC to refresh data in your document. 2) After successful reload another document which triggers... macro from first document to save that charts but with that it also gave me trouble as it generated conflict (you can not open Qlikview from Qlikview..... (I know that it is nosense) so in second document I run macro from first one like that (via PsExec):

EXECUTE "C:\Qlikview\PROD APPLICATION\modules\scripts\edx\PsExec64.exe" *\\SERVER_NAME* -u *SERVER_NAME\User* -p *password* -i 1 -d -high cmd /c ""C:\Program Files\QlikView\qv.exe"  "C:\Qlikview\PROD APPLICATION\modules\$(vDocument).qvw" /vvRun=yes

I use variable vRun to specify that macro on open runs only when it is set to yes:

enter image description here

and in macro it is set to close app after saving charts:

    ActiveDocument.UnlockAll
    ActiveDocument.ClearAll true
    ActiveDocument.Save
    ActiveDocument.GetApplication.quit

end sub
Hubert Dudek
  • 1,666
  • 1
  • 13
  • 21