randomGuy
randomGuy

Reputation: 3

adding microsoft.office.interop.excel to visual studio 2015 does not work

I currently making an inventory management system for thee company I am currently hired in. The system requires me to export data from DataGridView to Excel. I have tried clicking "Add Reference" to my references in solution explorer and selecting Microsoft.Office.Interop.Excel but after I click OK it still is not in my references. I tried it in my code but then I get this error:

Error CS0234 The type or namespace name 'Office' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)

Upvotes: 0

Views: 601

Answers (2)

Lucas_Poland
Lucas_Poland

Reputation: 48

It is not good to use this method. What if on somebody's computer there is not Excel? Try open source lib as EPPlus or as @Sagi mentioned Open XML

Upvotes: 1

Sagi
Sagi

Reputation: 1009

There are other methods of generation Excel files from C# without using the ineterop. One of the best ways is Open XML

Upvotes: 1

Related Questions