Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Honored Contributor 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


  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