This project is read-only.

First few questions regarding using NPOI with C#

Apr 5, 2011 at 5:02 PM

Why I am here? : I have developed a small application to format the Excel files in a specific format in order to import them into another third party application. The formatting tasks includes Adding rows & columns, rearranging the cols, removing un-necessary words, changing the data formats, checking the duplicate row etc. I am using Microsoft.Office.Interop.Excel objects in C# to do these tasks. Everything is running fine. However, when this program runs, the user cannot work or open another Excel workbook or Excel application. Whenever user try to open or work on another Excel file, this application is throwing an exception error. The core reason of the problem is Excel.Application object is not capable to handle multiple instances. If the program start work on this object it expects 'exclusive access' to this object. This becoming a major issue and need to find a good solution

I have posted few questions on MSDN to get some solution, but many of them pointed NPOI

My Questions

1. I am using Visual Studio 2010. Does NPOI current version supports .Net 4?

2. Most of our users having Office 2007; Does NPOI supports office 2007 and or .XLSX format files?

3. Can NPOI handle multiple instances of the Excel?

Please help me to find the answers for these question before I start to spend time on NPOI


Thanks a lot


Apr 5, 2011 at 5:58 PM

I only have experience with item #1. I have a test project running perfectly under .NET 4 with VS2010. I am still testing and have not learned to use all functions yet, but there doesn't seem to be any problem.

Regarding #3, I think you should have no problem because NPOI doesn't use Excel at all. Everything is done through raw file accesses rather than using Excel as an interface, so I think there won't be an issue.

Hope this helps.

Apr 5, 2011 at 7:11 PM

Thanks brimars for the reply. I wll try to do a small test project on this using VS2010 and Office 2007


Apr 6, 2011 at 8:19 AM

So far, NPOI only supports Office 2003 formats, which is compatible with Office 2007.