Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
ALERT: QlikView server communication interruptions following Microsoft Windows Domain Controller security updates
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Condition in Macro

hi Guys

can i write the following condition in Macro :

If there is no sheetobjects in a sheet then

------

else

------

Basically i want to check whether there is any sheet object in a particular sheet or not

Labels (1)
1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

You can use NoOfSheetObjects to get the number of objects on a sheet. If it is 0 then there are no objects.

set s=ActiveDocument.Sheets("Main")

if s.NoOfSheetObjects > 0 then

...do stuff

else

...do other stuff

end if


talk is cheap, supply exceeds demand

View solution in original post

5 Replies
Not applicable
Author

Why would you want to do that with macro's? They are not supported by Qlikview and it can be done with buttons aswell..

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

You can use NoOfSheetObjects to get the number of objects on a sheet. If it is 0 then there are no objects.

set s=ActiveDocument.Sheets("Main")

if s.NoOfSheetObjects > 0 then

...do stuff

else

...do other stuff

end if


talk is cheap, supply exceeds demand
Not applicable
Author

Can You give a small Example

Not applicable
Author

I can't reproduce one at the moment, but that's what Qliktech told me and why i don't use Macro's.. If your Macro doesn't work after an update you can't get support on them, while buttons should cover like 99% of the posibilities. Sorry

Not applicable
Author

hey Gysbert i have similar Condition with sheets

if Sheet1 exists then

--------------------

else

-----------------

can you help