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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Bug with a Attach/Detach PivotTables?

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?

2 Replies
Not applicable
Author

Even if button and tables belongs to the same sheet, but tables are minimized problem exists 😞

kji
Employee
Employee

Objects that are minimized or on another sheet are never calculated this is to optimize performance (only calculate what you can see).