Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I am trying to create an application to read data from an Excel file.

 

I have added a COM reference to excel using the reference add utility.

using Microsoft.Office.Interop.Excel;

I though this command would expose the excel commands to intellisense but that is not the case. Does doing the above make the excel stuff work even though it does not come up in Intellisense or am I missing a step?

 

MT

"Beer is proof that God loves us and wants us to be happy."

-Benjamin Franklin

  • 2 weeks later...
Posted

Excel interop article

 

A quick Google search revealed this interesting article (links to page 2). The article itself deals with creating Excel add-ons, but I would assume the basic stuff applies no matter what you're doing with Excel. Note that it mentions on page 1:

 

This technique only works with Office 2003. Older Office versions don't have the required functionality. When you install Office 2003, make sure you also include the .NET interoperability feature, because it's key in creating add-ons.

 

I guess if you're using an older version of Excel you'll need to inspect the types within the COM reference using the Object Browser (Ctrl+W,J). Not having Excel installed myself, I can't offer any specific advice on what to look for.

 

Good luck :cool:

Never trouble another for what you can do for yourself.
  • 3 weeks later...
Posted

Fixed...

 

using Excel = Microsoft.Office.Interop.Excel;

 

Just noticed this old post, this is how I fixed it, by setting the word "Excel" equal to the library name.

 

MTS

"Beer is proof that God loves us and wants us to be happy."

-Benjamin Franklin

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...