Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
f1234567
Contributor III
Contributor III

Macro stopps without error - only in version 12.20 -

Hi experts,

I found a strange behavior, starting with QV version 12.20. (In QV 11 it has been working all right):

After loading some data I want to export one file to excel.

I use this macro:

 Sub Excel_Export
'Export als Excel Datei
strFP3 = ActiveDocument.Variables("vExportPathCloud").GetContent.String

Set objExcel = ActiveDocument.GetSheetObject("CH57")
strName =  ActiveDocument.Variables("vNameExcelExp").GetContent.String
filepath3 = strFP3 &strName           'edit the location of file
objExcel.ExportBiff filepath3
msgbox("Datei "&filepath3&" erstellt")
End Sub

The test shows no errors and it worked fine in version 11.

Strange: 

Starting the macro: macro runs, then QV opens the macro, so that above text can be read. But it does not export the xls file.

So, first I thought the reason are the variables (vNameExcelExp,vExportPathCloud) . But the variables are generated and I can show them up in text-boxes.

My work-around:

I safe and close QV and then reopen QV. After that starting the macro works all right. The xls-file is exported.

I also tested:

Just saving QV and starting the macro: macro stopps

 

Has anybody of you seen a similar behavior?

What could be the reason?

Many thanks!
Frank

Labels (2)
1 Solution

Accepted Solutions
marcus_sommer

Just put a msgbox below each statement and you will find the point where the macro breaks. If you here returned the variable-values you could also check if they are correct within the macro, too. Also an On Error Resume Next and a msgbox err.number & err.description may give further hints to the cause. Other often needed statements in regard to exports are WaitForIdle- and Sleep-statements to ensure that Qlik finished all calculations before going to the next statement and to give the OS enough time to perform the addressed I/O.

Further your issue might be caused through a mixmatch of different releases - creating, updating and usage release and also between client and server releases. Another look might go to the use of prj-folders.

Beside this why upgrading now to 12.2 which is already out of support - and if I remember correctly the first releases of 12.2 has had some bugs. The most current version is 12.5 SR3.

- Marcus

View solution in original post

2 Replies
marcus_sommer

Just put a msgbox below each statement and you will find the point where the macro breaks. If you here returned the variable-values you could also check if they are correct within the macro, too. Also an On Error Resume Next and a msgbox err.number & err.description may give further hints to the cause. Other often needed statements in regard to exports are WaitForIdle- and Sleep-statements to ensure that Qlik finished all calculations before going to the next statement and to give the OS enough time to perform the addressed I/O.

Further your issue might be caused through a mixmatch of different releases - creating, updating and usage release and also between client and server releases. Another look might go to the use of prj-folders.

Beside this why upgrading now to 12.2 which is already out of support - and if I remember correctly the first releases of 12.2 has had some bugs. The most current version is 12.5 SR3.

- Marcus

f1234567
Contributor III
Contributor III
Author

Hi Marcus,

thanks a lot! 
Of course, you are right concerning the versions. However, I had no choice and had to install 12.20 😩

I now added some Sleep-statements after each variable setting  and it now works. I am testing now how many seconds of pausing at what step is necessary.

Thanks a lot!

Frank