• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 765
  • Last Modified:

namespace warning when trying to do "Imports Excel"

http://www.vbdotnetheaven.com/UploadFile/ggaganesh/ExcelSpreadsheet04182005093012AM/ExcelSpreadsheet.aspx

when I tried to compile the code from the above link I get warning shown below. I'm thinking its because I don't have Office 2003. My operating system is Windows 2000 Server and I have Office 2000 installed. I'm using VS 2005
Imports System
Imports System.Reflection ' For Missing.Value and BindingFlags
Imports System.Runtime.InteropServices ' For COMException
Imports Excel
 
Namespace or type specified in the Imports 'Excel' doesn't contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn't use any aliases.

Open in new window

0
zliminator
Asked:
zliminator
  • 5
  • 5
1 Solution
 
jjardineCommented:
Did you add the Office or Excel 9.0 reference to your project?
0
 
Rory ArchibaldCommented:
There is no official IA for Excel 2000 so you have to create your own using tlbimp as it says at the top of the article- did you do that?
0
 
Rory ArchibaldCommented:
There is no official IA for Excel 2000 so you have to create your own using tlbimp as it says at the top of the article- did you do that?
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
zliminatorAuthor Commented:
guess I didn't read the directions. I'll try in again when I get home.
0
 
zliminatorAuthor Commented:
OK, I did that: I used  TlbImp.exe &  Excel9.olb to make Excel.dll then I copied it to my bin directory of my project. Then I right-clicked on the sol. expl. and added it as a reference. Now I get the following warnings: (see attached jpgs)



autoexel.jpg
warnings1.jpg
0
 
Rory ArchibaldCommented:
Why do you have 2 Excel references and an Office and a VBIDE reference?
0
 
zliminatorAuthor Commented:
I have no idea how those got there. I should take them out, I guess.
0
 
zliminatorAuthor Commented:
It looks like I might have tried to load a project file for vs 2007 into vs2005 and it had the ref to VBIDE which doesn't work with 2005.
0
 
zliminatorAuthor Commented:
No, that's wrong - I got it from some sample files that came with the release of .net sdk 2.0.  When I look at the ref's in the explorer pane, it shows that Excel, Microsoft.Office.Core and VBIDE have the yellow warning icons next to them. I must be missing a driver or update. Yes?
0
 
Rory ArchibaldCommented:
The code you linked to doesn't require references to Office or the VBIDE so I don't understand why you don't simply remove them? If you need Office you would presumably need to build an Office 2000 IA too.
0
 
Rory ArchibaldCommented:
Marvellous.
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

  • 5
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now