-1

I am developing a winform desktop application that uses the Microsoft.Office.Interop.Excel library for processing Excel files.

I have included this file in the References section of my program, but when I build it as an exe and send it to another user's computer, they are required to download a Microsoft driver in order to use the Excel integration features.

How can I include the dll when I build my program, so that my users don't need to download and install a separate driver?

Updated to add: My users all have Microsoft Excel installed on their computers, so this is a different issue than the related question.

Here is the error message the user receives: Error reading the file ... Details: The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine.

lizziv
  • 183
  • 8
  • 1
    Does this answer your question? [How to use Microsoft.Office.Interop.Excel on a machine without installed MS Office?](https://stackoverflow.com/questions/11448197/how-to-use-microsoft-office-interop-excel-on-a-machine-without-installed-ms-offi) – Lance U. Matthews Apr 06 '20 at 20:38
  • If possible try using EPPlus [link](https://github.com/JanKallman/EPPlus) as this does not require MS Excel to be installed on the client computer. – lordvlad30 Apr 06 '20 at 20:42
  • @BACON I think they are running into a different problem than I am. My users all have MS Excel installed. – lizziv Apr 07 '20 at 14:28
  • 1
    This is not an interop error - it is an OLEDB error (treating excel files like databases). What version of Excel do the users have? You may need to install the appropriate [Database Engine Provider](https://www.microsoft.com/en-us/download/details.aspx?id=13255) – D Stanley Apr 07 '20 at 14:45
  • @DStanley Installing the database engine provider does resolve the issue for my users. So this means the issue is related to how I'm reading the Excel file (using OleDb), not the fact that I'm using Microsoft.Office.Interop.Excel. I used OleDb because my predecessor had written a program using the same technique and didn't have any issues with it. I will try using a different technique to read in the Excel file and see if the need for the driver goes away. – lizziv Apr 07 '20 at 19:11

1 Answers1

0

As i remember Microsoft.Office.Interop.Excel requires Microsoft Office to be installed on your target machine. I recommend you to use ExcelDataReader which allows you to work with Excel workbooks and does not require any additional drivers etc. Check it out!

Bulchsu
  • 580
  • 11
  • 33
  • All my users have the full Microsoft Office Suite, including Excel, installed on their computers. – lizziv Apr 07 '20 at 14:26