Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

Reading Value of variable in Macro

Hi Community,

I have a situation where a QV variable is stored to retrieve the selected chart. as below:

Example: vGraph = if(Graph='Line', CH01,

                                   If(Graph='Bar', 'CH02')

vGraph is a QV variable.

I am trying to export the chart to excel and trying to implement the value of selection of graph here.

So instead of GetSheetObject(qvObjectId). Can i use  ActiveDocument.GetVariable("vGraph ") in macro ?? So as to get the get sheet Object ID

Thanks in advance.

2 Replies
perumal_41
Valued Contributor II

Re: Reading Value of variable in Macro

try like below

set XLApp = CreateObject("Excel.Application") ' Define Object

XLApp.visible = true
Set XLDoc = XLApp.Workbooks.Add 'Open new workbook
set sheets = XLDoc.Sheets

ActiveDocument.GetSheetObject("CH01").CopyBitmapToClipboard

  
sheets(1).Paste

perumal_41
Valued Contributor II

Re: Reading Value of variable in Macro

try like below

Sub Test
set XLApp = CreateObject("Excel.Application") ' Define Object

XLApp.visible = true
Set XLDoc = XLApp.Workbooks.Add 'Open new workbook
set sheets = XLDoc.Sheets

vGraph1=ActiveDocument.GetVariable("vGraph").GetContent.String

ActiveDocument.GetSheetObject(vGraph1).CopyBitmapToClipboard


sheets(1).Paste

End sub

Community Browser