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: 
Yuhka
Contributor III
Contributor III

VBA Macro

Hello everyone, I'm new to qlikview and VBA macro.

I have an issue with VBA macro on my qvw.

Using macro, I would like to

  1. get the values on the text object (TX01)
  2. showing error message in case the text="0"

Now I can get the text but can't show the message. It seems the macro doesn't work.

Sub Check
msg = "not selected" 
set i = ActiveDocument.GetSheetObject("TX01").text
if i="0" then
MsgBox(msg)
end if
end Sub

I would make some mistakes on my expression, please help me.

Thank you for your support.

Labels (2)
1 Solution

Accepted Solutions
Frank_Hartmann
Master II
Master II

try this:

Sub Check
msg = "not selected"	
set mytextbox = ActiveDocument.GetSheetObject("TX01")
i = mytextbox.getText
if i="0" then 
MsgBox(msg) 
else Msgbox(i)
end if
end Sub

View solution in original post

3 Replies
Frank_Hartmann
Master II
Master II

try this:

Sub Check
msg = "not selected"	
set mytextbox = ActiveDocument.GetSheetObject("TX01")
i = mytextbox.getText
if i="0" then 
MsgBox(msg) 
else Msgbox(i)
end if
end Sub
Yuhka
Contributor III
Contributor III
Author

@Frank_Hartmann san,

Thank you for your quick reply.

It worked perfectly!

Claudiu_Anghelescu
Specialist
Specialist

set i = ActiveDocument.GetSheetObject("TX01")

To help community find solutions, please don't forget to mark as correct.