Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Good day,
I would like to change the size / position of objects with the QlikOCX.
Here is what I tried, because it works in VBScript:
Dim sheetObj As SheetObject
Dim newRect As IRect
Set sheetObj = QlikOCX.ActiveDocument.GetSheetObject("CH01")
Set newRect = sheetObj.GetRect
newRect.Width = 800
newRect.Height = 600
sheetObj.SetRect (newRect)
This return an error in Visual Basic:
Run-time error '430':
Class does not support Automation or does not support expected interface.
Does anybody knows what I have done wrong ?
I did found this:
<pre>
Dim sheetObj As SheetObject
Dim newRect As IRect
Dim sheetVariant As VariantSet sheetObj = QlikOCX.ActiveDocument.GetSheetObject("CH01")
Set sheetVariant = sheetObj
Set newRect = sheetVariant.GetRect
newRect.Width = 800
newRect.Height = 600
sheetObj.SetRect (newRect)
Not really neat, but it does the trick...
I did found this:
<pre>
Dim sheetObj As SheetObject
Dim newRect As IRect
Dim sheetVariant As VariantSet sheetObj = QlikOCX.ActiveDocument.GetSheetObject("CH01")
Set sheetVariant = sheetObj
Set newRect = sheetVariant.GetRect
newRect.Width = 800
newRect.Height = 600
sheetObj.SetRect (newRect)
Not really neat, but it does the trick...
Ok, I found a proper solution :
Set newRect = sheetObj.GetFrameDef.Rect