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: 
Not applicable

Syntax Error

Can anyone help fix the syntax on this macro? If the answer=6, then I want to run the macro called "format".

sub ShowPopup



Answer=MsgBox("Do you want to export search results to Excel?",4,"Export Search Results")



If Answer=6 Then

Run "format"

Else

Exit Sub     



End Sub

1 Solution

Accepted Solutions
MayilVahanan

Hi,

    

     Use like this,

     Call Format() or call Format

     Hope it helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.

View solution in original post

4 Replies
MayilVahanan

HI,

Sub ShowPopup

x=MsgBox("Would you like to export search results to Excel?",4,"Export Excel")

if x = 6 Then call exportToExcel("CH01", "C:\Export.xls")

End Sub

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Not applicable
Author

Instead of exporting to Excel in the Macro, what would the syntax be to just run the macro called "format"? Sorry, the question in the message box was misleading.

MayilVahanan

Hi,

    

     Use like this,

     Call Format() or call Format

     Hope it helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Not applicable
Author

Thanks!!