Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

C# Script to copy an Excel File working locally but not on the server when I schedule a job

$
0
0

So I have these couple C# commands to copy an Excel File which works fine and dandy on my local client when I test and run this SSIS Package but when I tried scheduling the job on the server, it failed.

These are the couple C# commands...

            //  This Opens the Source .xlsx File from Emdeon ePaySmart
            Workbook workbook = excelApplication.Workbooks.Open(StringSourceFile, XlUpdateLinks.xlUpdateLinksNever, true, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing);

            //  This will Save the Source .xlsx Emdeon ePaySmart File as a .xls File...note xlFileFormat.xlExcel5
            workbook.SaveAs(StringDestinationFile, XlFileFormat.xlExcel8, Type.Missing, Type.Missing, Type.Missing, Type.Missing, XlSaveAsAccessMode.xlExclusive, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing);

Is this because I'm using xlFileFormat.xlExcel8 and locally it is running fine but when I schedule via SQL Server Management Studio as a SQL Server Agent Job it seems to be failing??

I sure hope I don't have to change this so it will run as a SQL Server Agent Job and/or run this locally every blessed week.

Can someone clear this up for me and provide a potential solution?

Thanks for your review and am hopeful for a reply.

ITBobbyP85


Viewing all articles
Browse latest Browse all 24688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>