Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Exporting a text object content to excel using macro

Hi Everyone,

I am using the below macro to export two charts to excel,

sub exportexcelwhenfiltered2

set oXL=CreateObject("Excel.Application")

oXL.visible=True

oXL.Workbooks.Add

aSheetObj=Array("CH241","CH240")

for i=0 to UBound(aSheetObj)

oXL.Sheets.Add  

Set oSH = oXL.ActiveSheet

oSH.Range("A1").Select   

Set obj = ActiveDocument.GetSheetObject(aSheetObj(i))

obj.CopyTableToClipboard True

oSH.Paste

sCaption=obj.GetCaption.Name.v

set obj=Nothing    

oSH.Rows("1:1").Select

oXL.Selection.Font.Bold = True      

oSH.Cells.Select

oXL.Selection.Columns.AutoFit

oSH.Range("A1").Select   

oSH.Name=left(sCaption,30)  

set oSH=Nothing 

next

set oXL=Nothing

end sub

which works fine,

now i am trying to incorporate another object ID which is a text object to be exported to excel as third sheet,

I have no luck when I added the text object with ID TX880, it doesnt seem to work,

is there a way to do this?

0 Replies