Posted by Anuraj on Tuesday, September 9, 2014 Reading time :1 minute
In one of my project, I am using OpenXML SDK for opening Excel files. Recently I got an issue like SpreadsheetDocument.Open() method was throwing an IOException, if the Excel file is opened by MS Excel, even if I set the isEditable parameter false.
I fixed this problem by passing a stream instead of string (file path). And I used the File stream class to open the Excel file. Here is the code snippet.
Happy Coding :)
What do you think? I would like to hear your thoughts, suggestions, and questions in the comments section below.