Discover Availability Microsoft.Office.Interop.Excel

I am working on an application that can import data from several different formats. I would like to include CSV and other file types (easy), as well as XLS and XLSX.
It seems like my best option is to use Interop.Excel, which, as I understand it, is only available if Excel is installed.
Is there a way to check if Interop.Excel is available and tell the user that Excel should be installed to import from XLS / XLSX?

+5
source share
4 answers

Microsoft.Office.Interop.Excelis the Office Primary Interop Assembly , which you can send with your application, regardless of whether the client is installed in Office or not. It will not do any harm until you start using it. Therefore, before using it, you can look in the registry to see if Office is installed.

+7
source

If you want to support your own Microsoft Excel files and don’t want to depend on Microsoft Excel, look in OpenXML. This will only work with newly formatted Excel XML files. If your needs are simple and you just need to read data from an outdated Excel file or CSV file, you can use the Ace provider and / or Microsoft Jet OLE DB 4.0 providers

OpenXML / XML Excel. StackOverflow OpenXML, .

+1

All Articles