Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Macro conditional show in Excel

Hi all,

I have a variable in QV named "vDimesionShow" and I want to use this variable to determing which object to show. I have tried if-then statements to no avail. Could somebody please help with the syntax!!!

set v = ActiveDocument.Variables("vShowDimension") ....

if v.GetContent = 0 then

aryExport(5,0) = "TX1549"

aryExport(5,1) = "Sheet1"

aryExport(5,2) = "D34"

aryExport(5,3) = "image"

end if

if v.GetContent = 1 then

aryExport(5,0) = "TX1550"

aryExport(5,1) = "Sheet1"

aryExport(5,2) = "D34"

aryExport(5,3) = "image"

end if

3 Replies
Not applicable
Author

Maybe try adding .string at the end of the GetContent line to explicitly define it?

bbi_mba_76
Partner - Specialist
Partner - Specialist

Hi,

you could try this macro:

sub test

set v_macro = ActiveDocument.Variables("vShowDimension")

msgbox v_macro.GetContent.String

end sub

alexandros17
Partner - Champion III
Partner - Champion III

Try This

set v = ActiveDocument.GetVariable("showW")

  select case v.GetContent.String

     case 0

     ...

     case else

end select

Let me know