Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Have a very strange behavior in my Project. I have Sheet1 and sheet2. On Sheet1 exists button with an action Exec Macro DoRep
On Sheet2 two PivotTables. That's macros:
sub DoRep
set doc=ActiveDocument
set sh1=doc.GetSheetObject("chart1")
set sh2=doc.GetSheetObject("chart2")
set fie=doc.fields("field1")
sh2.Attach
doc.GetApplication.WaitForIdle
fie.Select "Cav"
fie.ToggleSelect "Fish"
fie.ToggleSelect "Cat"
fie.ToggleSelect "Dog"
'doc.recalldocbookmark "Table1"
doc.GetApplication.WaitForIdle
sh2.Detach
sh1.Attach
doc.GetApplication.WaitForIdle
fie.Select "Carrot"
fie.ToggleSelect "Mouse"
fie.ToggleSelect "Rat"
'doc.recalldocbookmark "Table2"
doc.GetApplication.WaitForIdle
sh1.Detach
end sub
Such a problem - if button belongs Sheet1 - macros doesnt makes correctly result, only if button on sheet2 all correct
Can You help me?
Even if button and tables belongs to the same sheet, but tables are minimized problem exists 😞
Objects that are minimized or on another sheet are never calculated this is to optimize performance (only calculate what you can see).