Solved

namespace warning when trying to do "Imports Excel"

Posted on 2009-03-31
11
744 Views
Last Modified: 2013-11-07
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
Comment
Question by:zliminator
  • 5
  • 5
11 Comments
 
LVL 14

Expert Comment

by:jjardine
ID: 24035280
Did you add the Office or Excel 9.0 reference to your project?
0
 
LVL 85

Expert Comment

by:Rory Archibald
ID: 24036291
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
 
LVL 85

Expert Comment

by:Rory Archibald
ID: 24036294
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
 

Author Comment

by:zliminator
ID: 24042679
guess I didn't read the directions. I'll try in again when I get home.
0
 

Author Comment

by:zliminator
ID: 24046130
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 85

Expert Comment

by:Rory Archibald
ID: 24055268
Why do you have 2 Excel references and an Office and a VBIDE reference?
0
 

Author Comment

by:zliminator
ID: 24056039
I have no idea how those got there. I should take them out, I guess.
0
 

Author Comment

by:zliminator
ID: 24068108
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
 

Author Comment

by:zliminator
ID: 24068160
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
 
LVL 85

Expert Comment

by:Rory Archibald
ID: 24069060
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
 
LVL 85

Accepted Solution

by:
Rory Archibald earned 250 total points
ID: 24180682
Marvellous.
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
Dealing with unintended Excel Active-X resizing quirks (VBA code simulates "self correction") David Miller (dlmille) Intro Not everyone is a fan of Active-X controls in spreadsheets (as opposed to the UserForm approach, the older Form controls …
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now