Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
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

1 Solution

Accepted Solutions

Re: Condition in Macro

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
5 Replies
Not applicable

Re: Condition in Macro

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

Re: Condition in Macro

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

Re: Condition in Macro

Can You give a small Example

Not applicable

Re: Condition in Macro

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

Re: Condition in Macro

hey Gysbert i have similar Condition with sheets

if Sheet1 exists then

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

else

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

can you help

Community Browser