Skip to main content
Announcements
YOUR OPINION MATTERS! Please take the Qlik Experience survey you received via email. Survey ends June 14.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Export multiple Container into Excel

Hi,

could somebody of you please help me?

I have a container with different diagrams. Now I want to export them into Excel.

Each Diagram should be exported (via XL-Button) to Excel but all in the same File just in different Sheets.

Solution In Excel:

How can I realize that?

Thanks in advance.

Chris

1 Solution

Accepted Solutions
mrossoit
Creator II
Creator II

Hi Christian,

you have to use macro to do this. XL button is limited.

At the moment I don't know how to cycle through container's objects but you could try this:

sub export()

    set XLApp = CreateObject("Excel.Application")

    set XLDoc = XLApp.Workbooks.Add 

    do while XLApp.ActiveWorkbook.Worksheets.Count < 5 'if you want to export 5 charts

       XLApp.ActiveWorkbook.Worksheets.Add

    loop

    for i = 1 to 5

        set obj = ActiveDocument.GetSheetObject("CH"& right("0"&i,2)) 'your carts'id have to be from 1 to 5

        Set rngStart = XLDoc.Sheets(i).Range("A1")

        obj.CopyTableToClipboard true

        XLDoc.Sheets(i).Paste()

           XLApp.Sheets(i).Name = obj.GetCaption.Name.v

    next   

end sub

Hope it helps.

Regards,

MR

View solution in original post

1 Reply
mrossoit
Creator II
Creator II

Hi Christian,

you have to use macro to do this. XL button is limited.

At the moment I don't know how to cycle through container's objects but you could try this:

sub export()

    set XLApp = CreateObject("Excel.Application")

    set XLDoc = XLApp.Workbooks.Add 

    do while XLApp.ActiveWorkbook.Worksheets.Count < 5 'if you want to export 5 charts

       XLApp.ActiveWorkbook.Worksheets.Add

    loop

    for i = 1 to 5

        set obj = ActiveDocument.GetSheetObject("CH"& right("0"&i,2)) 'your carts'id have to be from 1 to 5

        Set rngStart = XLDoc.Sheets(i).Range("A1")

        obj.CopyTableToClipboard true

        XLDoc.Sheets(i).Paste()

           XLApp.Sheets(i).Name = obj.GetCaption.Name.v

    next   

end sub

Hope it helps.

Regards,

MR