This project has moved. For the latest updates, please go here.

How to Add Sheet from One Excel file to another File?

Apr 5 at 4:24 PM
Here is my code in VS2012 SSIS script:
    Dim GLReconFile As String = Dts.Variables("User::v_TmpFile").Value
    Dim PBSummaryPath As String = Dts.Variables("User::v_OutputPath").Value
    Dim PBFileSearchPattern As String = Dts.Variables("User::v_PBFileSearchPattern").Value
    Dim PBSummaryFile As String = FindFile(PBSummaryPath, PBFileSearchPattern)

    Dim MasterPackage As ExcelPackage = New ExcelPackage(New FileInfo(GLReconFile))
    Dim SourcePackage As ExcelPackage = New ExcelPackage(New FileInfo(PBSummaryFile))

    MasterPackage.Workbook.Worksheets.Add("Test", SourcePackage.Workbook.Worksheets(1))
    MasterPackage.Save()

    Dts.TaskResult = ScriptResults.Success
I get "unable to save error"

Thanks for any help,
Leo

FYI : i cant find any working examples anywhere.