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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
m_woolf
Master II
Master II

macro to change the show condition for all objects on a sheet

I have written the macro below to change the show condition for all objects on a sheet. I get an error message on the blnTEST line when the object is a chart or a Button. The error says that the object doesn't support the property or method.

Any suggestions?

Objects = ActiveDocument.Activesheet.GetSheetObjects

For j = lBound(Objects) To uBound(Objects)

  set obj = Objects(j)

  strID = obj.GetObjectID

  set p = obj.GetProperties

  on error resume next

  blnTEST = p.Layout.Frame.Show.Always '*** Here is where the error occurs ***

  if err.number >0 then

  msgbox strID & "  " & err.description

  on error goto 0

  else

  if p.Layout.Frame.Show.Always = false then

  strCondition = p.Layout.Frame.Show.Expression.v

  strCondition = Replace (strCondition, "RDAC\", "AMU\")

  p.Layout.Frame.Show.Expression.v = strCondition

  end if

  end if

  obj.SetProperties p

next 'j - object

0 Replies