Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
this is a very weird situation.
I have a simple script to export a csv file that is called when OnPostReload event is fired.
Sub ExportToCSV
set sObject1 = ActiveDocument.GetSheetObject("ClientiUnivoci")
sObject1.Export "Output\ClientiUnivoci_Week_" & Year(Now()) & LPad(Month(Now()),"0",2 ) & LPad(Day(Now()),"0",2 ) & ".csv", ";", 65001
End Sub
When I launch reload inside qlikview the script works fine and the file is generated, when I lanch qlikview reload from a batch file using the following command:
"C:\Program Files\QlikView\Qv.exe" /r "C:\Qlikview\Project\LastWeek.qvw"
the qlikview file is reload but the macro is not executed and the csv file is not generated.
I made the following attemps without success:
I don't really know what to do more.
Do you have any ideas?
Thanks in advance.
Nicola
Yes exactly, I double click on the .bat file with the goal of inserting it in a scheduled task.
I use the same approach since years too, but I never faced a case like this. I'm working on it since yesterday evening but I still haven't found a solution...
It sounds stupid now but try to change the trigger maybe to OnOpen, replace the routine with a simple msgbox or selection-action, create a complete new qvw with a small inline-table and a tablebox and use your export-routine again (something files get corrupted), further trial and error ...
Have you those app created himself or it's from another person maybe even downloaded from a server or mailed to you - sometimes windows creates flags for this which could prevent an remote-execution.
Finally I resolved the issue!!!!! Qlikview doesn't care about a relative path if the reload is executed inside the application. If the reload is executed externally from a command line you need to insert the full path in the script:
WRONG SCRIPT:
Sub ExportPercentileSettimana
set sObject2 = ActiveDocument.GetSheetObject("Percentile")
sObject2.ExportBiff "Output\Percentile_Week_" & Year(Now()) & LPad(Month(Now()),"0",2 ) & LPad(Day(Now()),"0",2 ) & ".xls"
End Sub
RIGHT SCRIPT:
Sub ExportPercentileSettimana
set sObject2 = ActiveDocument.GetSheetObject("Percentile")
sObject2.ExportBiff "C:\Users\sarnic\Documents\Progetti\Aperti\Project\Sviluppo\Report\Output\Percentile_Week_" & Year(Now()) & LPad(Month(Now()),"0",2 ) & LPad(Day(Now()),"0",2 ) & ".xls"
End Sub
Hope this may help someone else.
Thanks to everyone.
Nicola
Mostly it are the small things ...