SSIS: Make Excel Visible In Script Task During SQL Server Agent Job Run

后端 未结 2 1135
一生所求
一生所求 2020-12-04 01:11

I built a package in SSIS that uses a script task to open an Excel file, format, and refresh some data in Excel. I would like to have Excel visible when the script task is r

2条回答
  •  春和景丽
    2020-12-04 01:49

    Regarding your first question, I understand that you want to debug your script task. You can make Excel visible by adding the following line of code in your script task (assuming C# is the coding language):

        // Create your Excel app
        var excelApp = new Excel.Application();
    
        // Make the Excel window visible to spot any issues
        excelApp.Visible = true;
    

    Don't forget to remove/comment that line after debugging.

    Regarding your second question, I don't that this is a bad idea if you properly handle how Excel is opened and closed, in order to avoid memory issues.

提交回复
热议问题