Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Error with a macro

Hello, Merry Christmas and happy holidays!
I'm having an issue with a macro that exports some tables from QlikView to an Excel document.
I'm trying to do some coloring in all of its sheets, as per customer's requirements, but I keep getting "Expected end of statement" at this For loop, and I don't know why:

For i = 1 To 6

    XLDoc.Sheets(i).Select

    XLDoc.Sheets(i).Range("A1:C2,K1:Q2,Q3:Q37,Y1:AE2,AE1:AE19").Interior.Color = RGB(255,255,0)

next i  

Any ideas? I'm new to VBA so I'll appreciate all the help I can get

1 Solution

Accepted Solutions
petter
Partner - Champion III
Partner - Champion III

QlikView does not use the VBA (Visual Basic for Applications). It supports the  VBS (Visual Basic Script) which is the little brother of VBA. Not as capable.

VBS syntax does not support the variable name after the NEXT statement. It supports only the Next. So simply by removing the i after Next your syntax error will be gone.

2017-12-28 10_29_47-Edit Module.png

View solution in original post

4 Replies
tamilarasu
Champion
Champion

petter
Partner - Champion III
Partner - Champion III

QlikView does not use the VBA (Visual Basic for Applications). It supports the  VBS (Visual Basic Script) which is the little brother of VBA. Not as capable.

VBS syntax does not support the variable name after the NEXT statement. It supports only the Next. So simply by removing the i after Next your syntax error will be gone.

2017-12-28 10_29_47-Edit Module.png

Anonymous
Not applicable
Author

This explains a lot...
Thanks for the info.

YUVARAJ
Contributor
Contributor

Hi   Peter,

QlikView license is automatically converted to personal edition during run time of automatic scheduled  jobs.

And the jobs are carrying the macro programming .the above error is comming.Please help with the solution.

but we are getting this  error around 500+ report a day we are getting this during every batch file run.

 

 

YUVARAJ_0-1677574574564.png

 

Regards,

Yuvaraj G

Yuvarajqlik1994@gmail.com