Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
wonkymeister
Creator III
Creator III

Macro Help - Set a Cell Value with Variable

Hi,

i need to set a cell in a straight table with a value from a variable.

but my code isn't setting the cell with the value from the variable, instead its deleting the value from the variable. i think its getting the cell value (null) and setting the variable to it (null)

rather than doing what i want which is to get the value from the variable and setting it to the cell!

Sub GetTotal

set ch = ActiveDocument.GetSheetObject("CH01").GetCell(1,5)  'empty cell to populate

set vVar = ActiveDocument.Variables("vMyVariable") 'my variable that stores the value

vVar.SetContent ch.text, false

End Sub

Help!

Cheers.

1 Solution

Accepted Solutions
Gysbert_Wassenaar

Qlikview is not a spreadsheet application like MS-Excel. It is not possible to set the value of a single cell. The values in the cells are calculated based on the dimensions and expressions of the chart (and the selections made by the user).


talk is cheap, supply exceeds demand

View solution in original post

3 Replies
Gysbert_Wassenaar

Qlikview is not a spreadsheet application like MS-Excel. It is not possible to set the value of a single cell. The values in the cells are calculated based on the dimensions and expressions of the chart (and the selections made by the user).


talk is cheap, supply exceeds demand
wonkymeister
Creator III
Creator III
Author

the API provides a method called SetInputFieldCell which only works with a straight table box:

set obj = ActiveDocument.GetSheetObject("CH68")
obj.SetInputFieldCell 0,3,"999" 'set value in 2nd row, 2nd column to 999

Why wouldn't this work?

wonkymeister
Creator III
Creator III
Author

Thanks Gysbert - i get it now.