Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
hykal1993
Contributor II
Contributor II

How to Combine Multiple Files into one Excel workbook with different worksheer

Hi,

I have written Macro code to export few report (Main, Enabler and Wholesale). I would like to retain and add another code to extract all the report into one with multiple sheet. Any idea, guys? My code is below, rather not change much

'Main

sub exportToExcelMain

Dim path

path = getExportPathMain()

dim o

Set o = ActiveDocument.GetSheetObject("Main")

o.ExportBiff path

Set o = nothing

msgbox("Export to " & path & " succeeded!")

end sub

function getExportPathMain

getExportPathMain = ActiveDocument.Variables("Main Export").GetContent.String

end function

'Enabler

sub exportToExcelEnabler

Dim path

path = getExportPathEnabler()

dim o

Set o = ActiveDocument.GetSheetObject("Enabler")

o.ExportBiff path

Set o = nothing

msgbox("Export to " & path & " succeeded!")

end sub


function getExportPathEnabler

getExportPathEnabler = ActiveDocument.Variables("Enabler Export").GetContent.String

end function

'Wholesale

sub exportToExcelWholesale

Dim path

path = getExportPathWholesale()

dim o

Set o = ActiveDocument.GetSheetObject("Wholesale")

o.ExportBiff path

Set o = nothing

msgbox("Export to " & path & " succeeded!")

end sub

function getExportPathWholesale

getExportPathWholesale = ActiveDocument.Variables("Wholesale Export").GetContent.String

end function

10 Replies
hykal1993
Contributor II
Contributor II
Author

Thank you so much, it works!