Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
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
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