Office Object References don't work??
Office Object References don't work??
Office Object References don't work??
Office Object References don't work??
Office Object References don't work??
Office Object References don't work?? Office Object References don't work?? Office Object References don't work?? Office Object References don't work?? Office Object References don't work?? Office Object References don't work?? Office Object References don't work?? Office Object References don't work??
Office Object References don't work?? Office Object References don't work??
Office Object References don't work??
Go Back  Xtreme Visual Basic Talk > > > Office Object References don't work??


Reply
 
Thread Tools Display Modes
  #1  
Old 03-01-2005, 09:30 PM
gravity7's Avatar
gravity7 gravity7 is offline
Regular
 
Join Date: May 2004
Location: Nashville, TN
Posts: 92
Question Office Object References don't work??


I have added a reference to the Excel Object 11.0 Library, yet when I try to create a new excel object, it does not show up as a valid object. The references are set as follows:

Excel
Microsoft.Office.Core
System
System.Data
System.Drawing
System.Windows.Forms
VBIDE

Using this code anywhere generates an error:

Code:
dim xlApp as New Excel.Application
The error is:
Quote:
Type 'excel.application' is not defined.
Am I missing something?

I have Office 2003 installed and VB.Net 2003.
Reply With Quote
  #2  
Old 03-02-2005, 04:53 PM
Mike Rosenblum's Avatar
Mike Rosenblum Mike Rosenblum is offline
Microsoft Excel MVP

Forum Leader
* Guru *
 
Join Date: Jul 2003
Location: New York, NY, USA
Posts: 7,848
Default

Yes, but it's very easy to fix.

Just put the following at the very top of your code document:
Code:
Imports Excel = Microsoft.Office.Interop.Excel
Basically, your references were set, but you did not define (in code) what 'Excel' was.

But this is an omission in my Tutorial, I'll have to go add that...
__________________
My Articles:
| Excel from .NET | Excel RibbonX using VBA | Excel from VB6 | CVErr in .NET | MVP |
Avatar by Lebb
Reply With Quote
  #3  
Old 03-03-2005, 03:26 PM
gravity7's Avatar
gravity7 gravity7 is offline
Regular
 
Join Date: May 2004
Location: Nashville, TN
Posts: 92
Default

Thank you! That fixed the problem!
Reply With Quote
  #4  
Old 03-03-2005, 03:51 PM
Mike Rosenblum's Avatar
Mike Rosenblum Mike Rosenblum is offline
Microsoft Excel MVP

Forum Leader
* Guru *
 
Join Date: Jul 2003
Location: New York, NY, USA
Posts: 7,848
Default



No problem!
__________________
My Articles:
| Excel from .NET | Excel RibbonX using VBA | Excel from VB6 | CVErr in .NET | MVP |
Avatar by Lebb
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Office Object References don't work??
Office Object References don't work??
Office Object References don't work?? Office Object References don't work??
Office Object References don't work??
Office Object References don't work??
Office Object References don't work?? Office Object References don't work?? Office Object References don't work?? Office Object References don't work?? Office Object References don't work?? Office Object References don't work?? Office Object References don't work??
Office Object References don't work??
Office Object References don't work??
 
Office Object References don't work??
Office Object References don't work??
 
-->