Corruption issue when reading a copy of an Excel file

495 views
Skip to first unread message

Christi Edwards

unread,
May 4, 2017, 11:36:26 AM5/4/17
to COZYROC
I use Excel Source Plus to read various Excel files that I use in my daily processing.  The usual procedure is that the file is copied to a working folder with C#, then read by the SSIS package and the data processed.  However, if the file is open when it's copied to the working folder, I get the following error:

An error occurred with the following error message: "The file is not on any of the formats supported by FlexCel (Excel 5 or newer, pxl, text or xlsx)." 

The error code returned is 0xC020801C.

This is 100% repeatable on any file in my network (I don't have the ability to test on files outside the network).  Is this an existing bug that's being worked on, or is there a workaround other than just bypassing the task when the file is likely to have been corrupted on copy? 

If I were reading the file that is in use, I could almost understand it.  But the copy doesn't have any network or read locks on it, at least from what I can tell.

Thanks!

Ivan Peev

unread,
May 4, 2017, 3:37:04 PM5/4/17
to COZYROC
Hi Christi,

I suspect the copy you create with your C# code is corrupt.

I found a discussion about checking if Excel workbook is open here: http://stackoverflow.com/questions/9373082/detect-whether-excel-workbook-is-already-open

I recommend you use the simple code, which doesn't depend on the Excel automation code . 
Reply all
Reply to author
Forward
0 new messages