Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi , i have a macro that export images, when i run this in the qlikview with a button it works perfect.
When i run this with a batfile, it's reloading the qv but the last thing happend is that the macrowindows stays open and nothing more happens.
Batfile:
"C:\Program Files\QlikView\Qv.exe" /l /NoSecurity "C:\Qv\MXXX.qvw"
Macro:
function exportImages
' Test if export should be made
set v = ActiveDocument.Variables("RunNow")
if v.GetContent.String = "Yes" then
v.SetContent "No",true
exportAll
ActiveDocument.GetApplication.Quit
end if
end function
function exportAll
export("CH01")
export ("TX01")
end function
function export(chartId)
set obj = ActiveDocument.GetSheetObject(chartId)
obj.ExportBitmapToFile "C:\UTL\Chart_" & chartId & ".png"
end function
What can i do to get this working?
Br
Disable the last option because enabled it will show a popup to agree to the macro execution and the batch couldn't do it.
- Marcus
Ah, perfect.
It runs manually, but still the batfile will not close the macrowindow
With batch the export worked? And it remains with open module-editor or QV as applications is left open?
- Marcus
it remains with open module-editor
Hey all, i tested with QV.exe (8.50) and it works. The only thing now is to save and close the whole QlikView Window.
Can i put this in my bat file in the end?
ActiveDocument.Save
Application.Quit
Not in the bat - at the end from the macro.
- Marcus
Okay i did that. But i cannot edit the macro any more, it crashes in both QV12 and QV8.50
suggestions?
The quit-statement isn't quite right - it must be:
ActiveDocument.GetApplication.Quit
- Marcus
Hahaha, okay i must rebuild the QlikView now. I cant edit anymore 😂
Marcus, is this wrong? The qv application will not qiut
function exportImages
' Test if export should be made
set v = ActiveDocument.Variables("RunNow")
if v.GetContent.String = "Yes" then
v.SetContent "No",true
exportAll
ActiveDocument.GetApplication.Quit
end if
end function
function exportAll
export("CH01")
export ("TX01")
end function
function export(chartId)
set obj = ActiveDocument.GetSheetObject(chartId)
obj.ExportBitmapToFile "C:\inetpub\wwwroot\as400\UTL\Chart_" & chartId & ".png"
ActiveDocument.GetApplication.Quit
end function