Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
This work fine
-----------------------------------
Sub ThemeMountain()
Set obj01 = ActiveDocument.GetSheetObject("CS01")
Set obj02 = ActiveDocument.GetSheetObject("BU08")
Set obj03 = ActiveDocument.GetSheetObject("BU09")
Set obj04 = ActiveDocument.GetSheetObject("BU10")
obj01.ApplyTheme "D:\QlikView\Develop\Themes\Mountain.qvt"
obj02.ApplyTheme "D:\QlikView\Develop\Themes\Mountain.qvt"
obj03.ApplyTheme "D:\QlikView\Develop\Themes\Mountain.qvt"
obj04.ApplyTheme "D:\QlikView\Develop\Themes\Mountain.qvt"
End sub
---------------------------------------
But if I want to get all objects in the active sheet how can I program a macro to change all objects
Testing
Sub ThemeMountain2()
Dim obj as Object
' Set vPath = "D:\QlikView\Develop\Themes\Espresso.qvt"
For each obj in ActiveSheet
obj.ApplyTheme "D:\QlikView\Develop\Themes\Mountain.qvt"
' obj.ApplyTheme vPath
Next obj
End sub
This macro will set a theme on all ojects in all sheets in the document:
Sub SetTemplateOnAllObects
for j = 0 to ActiveDocument.NoOfSheets - 1
Objects = ActiveDocument.GetSheet(j).GetSheetObjects
for i = lBound(Objects) To uBound(Objects)
set obj = Objects(i)
obj.ApplyTheme "c:\qv_theme.qvt"
next
next
End Sub
Good luck!
Just skip the first loop (all sheets) and you should be ok.
//Robert Svebeck