Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

AddDimension fails while working with hidden chart

I am using QV 9 SR4.

On click of a button, I need to add a new dimension to one straight table that is currently shown and also to another straight which is currently hidden. Using below code to add a dimension

ActiveDocument.GetSheetObject(objName).AddDimension "column"

It works fine for the straight table that is active. But fails when it tries to add the dimension to the hidden straight table. There is no error message as well. For debug, I added an alert to show ActiveDocument.GetSheetObject(objName).GetObjectId and this shows correct id even for the hidden table.

Is there a limitation with AddDimension api to not work with hidden charts? Is there any alternative somone can suggest plz?

Thanks!

2 Replies
Not applicable
Author

Bump!

Not applicable
Author

there was a bug in the initial release of qlikview 9 preventing access to objects which were not on the current sheet, it was partly fixed in the SR1, but some methods still exhibit different behaviors depending of the current active sheet, so it is possible you experience that

there was also a bug in a 8.5 version which generates an error if the adddimension method was called when no expression exists. i don't know if it was fixed but the solution is to call addexpression before adddimension

if you are using the QlikView OCX embedded in another application, the workaround for the hidden objects bug is to call the LockPaint() method of the OCX (it disables the refreshing of the component), active the hidden sheet, do your stuff, active the sheet that was active before and call the UnlockPaint method.

note that you'll run into a lot of problems if you do that (especially with macros triggered by activation/deactivation of sheet)

if you are using this code in a macro of a qlikview document, i have no workaround to provide