Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
shruthibk
Creator
Creator

Export chart title

Hi,

1)how can i export chart title name,there are many charts in three sheets how can i export chart title name ,i tried changing object id but it is not working in ajax client also i tried some macros but they are throwing some errors.

2) How to export chart with filter selection at the top,in excel file filter selection should show at the top.

Thanks,

shruthi

7 Replies
bindu_apte
Creator III
Creator III

Hi Shruthi,

Try this.

sub ExportExcel()

'create Excell

        Set xlApp = CreateObject("Excel.Application")

        xlApp.Visible = true

  

        Set xlDoc = xlApp.Workbooks.Add()

        Set xlSheet = xlDoc.Worksheets.Add

        Set SheetObj = ActiveDocument.GetSheetObject("CH01")  

'copy Label

        chartCaption = SheetObj.GetCaption.Name.v

        xlSheet.Range("A1") = chartCaption

'copy table content

        SheetObj.CopyTableToClipboard true  

        xlSheet.Range("A2").PasteSpecial  Paste = xlPasteValues

      

End sub

shruthibk
Creator
Creator
Author

i tried all the macros they are throwing error like this ActiveX component can't create object: 'Excel.Application'

shruthibk
Creator
Creator
Author

i tried all the macros they are throwing error like this ActiveX component can't create object: 'Excel.Application'

bindu_apte
Creator III
Creator III

Hi Shruthi,

Can you share the macro which you are using?

avinashelite

You need to check the allow system access in the Macro edit window . Press Ctrl+M and in the left hand side you will see the access part . Select allow system access , Hope this helps you

susovan
Partner - Specialist
Partner - Specialist

Hi shruthi,

Try this process and also check the attachment,

Please change the path.

sub ExcelFile

strDate = CDate(Date)

  strDay = DatePart("d", strDate)

  strMonth = DatePart("m", strDate)

  strYear = DatePart("yyyy", strDate)

  If strDay < 10 Then

    strDay = "0" & strDay

  End If

  If strMonth < 10 Then

    strMonth = "0" & strMonth

  End If

  GetFormattedDate = strMonth & "-" & strDay & "-" & strYear

Path = "D:\SUSOVAN_WORK\@_Qlik_Tab Application\"  


FileName = "Sales_" & GetFormattedDate  & ".xlsx"

Set XLApp = CreateObject("Excel.Application")

XLApp.Visible = True

set XLDoc = XLApp.Workbooks.Add

ActiveDocument.GetSheetObject("EXPORT").CopyTableToClipboard true

XLDoc.Sheets(1).Paste()

XLDoc.Sheets(1).Columns("A:D").EntireColumn.AutoFit

XLDoc.Sheets(1).Columns("A:A").ColumnWidth = 15.57

XLDoc.Sheets(1).Columns("B:B").ColumnWidth = 12.43

XLDoc.Sheets(1).Columns("C:C").ColumnWidth = 15.29

XLDoc.Sheets(1).Columns("D:D").ColumnWidth = 15.57

XLDoc.Sheets(1).Name = "CH01"

XLDoc.SaveAs Path & FileName

End Sub


4.JPG



Warm Regards,
Susovan