473,327 Members | 2,094 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Excel not working? What gives

Having used every combonation of excel 9/10/11 and office 10/11 possible as
references i still can not create an excel object! Any ideas?

Just using this simple bit below i get "Excel.appication not defined"

dim xlApp as Excel.Application, xlWs as Excel.WorkSheet
set xlApp = new Excel.Application
Nov 20 '05 #1
6 11666
Hi Brent,

Don't use 'set':
Dim objxl As Excel.Application

Dim objwbs As Excel.Workbooks

Dim objwb As Excel.Workbook

Dim objws As Excel.Worksheet

objxl = New Excel.Application

This worked for me.

HTH,

Bernie Yaeger

"Brent" <Br***@nunyabuisness.com> wrote in message
news:jb*******************@newssvr25.news.prodigy. com...
Having used every combonation of excel 9/10/11 and office 10/11 possible as references i still can not create an excel object! Any ideas?

Just using this simple bit below i get "Excel.appication not defined"

dim xlApp as Excel.Application, xlWs as Excel.WorkSheet
set xlApp = new Excel.Application

Nov 20 '05 #2
same error with your method as well.. it underlines excel.application in the
first line as if it somehow is not accessing the references :(
"Bernie Yaeger" <be*****@cherwellinc.com> wrote in message
news:e1**************@TK2MSFTNGP12.phx.gbl...
Hi Brent,

Don't use 'set':
Dim objxl As Excel.Application

Dim objwbs As Excel.Workbooks

Dim objwb As Excel.Workbook

Dim objws As Excel.Worksheet

objxl = New Excel.Application

This worked for me.

HTH,

Bernie Yaeger

"Brent" <Br***@nunyabuisness.com> wrote in message
news:jb*******************@newssvr25.news.prodigy. com...
Having used every combonation of excel 9/10/11 and office 10/11 possible

as
references i still can not create an excel object! Any ideas?

Just using this simple bit below i get "Excel.appication not defined"

dim xlApp as Excel.Application, xlWs as Excel.WorkSheet
set xlApp = new Excel.Application


Nov 20 '05 #3
You probably don't have a reference to the COM Excel wrapper in your
References for the project.

This works for me, but it uses COM, and I don't know if .Net has direct
support for Excel yet:

1. Open Solution Explorer.
2. In the Project, right-click on References and choose Add Reference.
3. Select the COM tab.
4. Scroll down until you see Microsoft Excel <whatever> (Hint: type the
letter "M" to quickly scroll near to where you need to be in the list).
5. Highlight the Microsoft Excel entry (I had two, one for Excel 5 and one
for Excel 8) and click Select.
6. Click OK to close the dialog.

Open up a module and type the following

dim justatest as

As soon as you type the word "as", Intellisense should pop up and allow you
to type the letters Ex and the selection list should scroll to
Excel.Application. I just did this little exercise on a sample project that
had nothing to do with Excel and it works fine.
<Br***@nunyabuisness.com> wrote in message
news:jb*******************@newssvr25.news.prodigy. com...
Having used every combonation of excel 9/10/11 and office 10/11 possible as references i still can not create an excel object! Any ideas?

Just using this simple bit below i get "Excel.appication not defined"

dim xlApp as Excel.Application, xlWs as Excel.WorkSheet
set xlApp = new Excel.Application

Nov 20 '05 #4
* "Brent" <Br***@nunyabuisness.com> scripsit:
Having used every combonation of excel 9/10/11 and office 10/11 possible as
references i still can not create an excel object! Any ideas?

Just using this simple bit below i get "Excel.appication not defined"

dim xlApp as Excel.Application, xlWs as Excel.WorkSheet
set xlApp = new Excel.Application


HOWTO: Automate Microsoft Excel from Visual Basic .NET
<http://support.microsoft.com/default.aspx?scid=kb;en-us;301982>

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #5
I'mt telling ya, this is the weirdest thing.. I have clearly refrenced the
required excel object, however, excel.anything doesnt exist in the
autocomplete. Excel doesn't exist in the autocomplete..

Dim test as (no excel in autocomplete here)
--------------
Ahh it finally worked

I had to use the full namespace for some reason to get to it..

Dim test As Microsoft.Office.Interop.Excel.Application

Thats the only way i was able to create an excel object... Any idea why I
have to do it this way?



"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:bq*************@ID-208219.news.uni-berlin.de...
* "Brent" <Br***@nunyabuisness.com> scripsit:
Having used every combonation of excel 9/10/11 and office 10/11 possible as references i still can not create an excel object! Any ideas?

Just using this simple bit below i get "Excel.appication not defined"

dim xlApp as Excel.Application, xlWs as Excel.WorkSheet
set xlApp = new Excel.Application


HOWTO: Automate Microsoft Excel from Visual Basic .NET
<http://support.microsoft.com/default.aspx?scid=kb;en-us;301982>

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>

Nov 20 '05 #6
Hi Brent,

Try removing your reference and then readding it. My guess is you did not
have the com object loaded, or else you had one that was misbehaving.

Bernie

"Brent" <Br***@nunyabuisness.com> wrote in message
news:mn*******************@newssvr25.news.prodigy. com...
I'mt telling ya, this is the weirdest thing.. I have clearly refrenced the required excel object, however, excel.anything doesnt exist in the
autocomplete. Excel doesn't exist in the autocomplete..

Dim test as (no excel in autocomplete here)
--------------
Ahh it finally worked

I had to use the full namespace for some reason to get to it..

Dim test As Microsoft.Office.Interop.Excel.Application

Thats the only way i was able to create an excel object... Any idea why I
have to do it this way?



"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:bq*************@ID-208219.news.uni-berlin.de...
* "Brent" <Br***@nunyabuisness.com> scripsit:
Having used every combonation of excel 9/10/11 and office 10/11
possible
as references i still can not create an excel object! Any ideas?

Just using this simple bit below i get "Excel.appication not defined"

dim xlApp as Excel.Application, xlWs as Excel.WorkSheet
set xlApp = new Excel.Application


HOWTO: Automate Microsoft Excel from Visual Basic .NET
<http://support.microsoft.com/default.aspx?scid=kb;en-us;301982>

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>


Nov 20 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Prasad Patil | last post by:
Hi, I have installed Office 2000 & Office 2003 on my Machine I wish to use excel 2003 in my Dot Net Project When I reference the Microsoft Excel 5.0 Object library the code using Excel...
4
by: IMS.Rushikesh | last post by:
Hi All, I am trying to execute below code but it gives me an COMException ///// Code Start //// public string GetName(Excel.Range range) { try { if (range.Name != null)
0
by: Prasad Patil | last post by:
Hi, I have installed Office 2000 & Office 2003 on my Machine I wish to use excel 2003 in my Dot Net Project When I reference the Microsoft Excel 5.0 Object library the code using Excel...
1
by: Glen Vermeylen | last post by:
Hi, For a project at school we have to automate the assignment of seats in classrooms to students during the exams. The lady who previously did everything manually kept the layouts of the...
10
by: Steve | last post by:
I am trying to create a DLL in Visual Studio 2005-Visual Basic that contains custom functions. I believe I need to use COM interop to allow VBA code in Excel 2002 to access it. I've studied...
2
by: James | last post by:
I am doing some Excel 2000 automaton using Vb 2005. I am referencing the Excel 9.0 COM Object Library. The following code was working fine: Dim xlApp as new Excel.Application Dim xlWb as...
7
by: semijoyful | last post by:
OS: Win XP SP2 Access version: 2003 Excel version: 2003 I am new at this, as I am sure you have gathered from this post title:) I am working on a form where users can input data in Access and...
15
by: =?Utf-8?B?c2hhc2hhbmsga3Vsa2Fybmk=?= | last post by:
Hi All, We are in the process of Upgrade Excel 2003 (Office 2003) to Excel 2007 (Office 2007) for one of web application. This web application is using Excel (Pivot Table) reports. With Excel...
16
by: Phil Stanton | last post by:
I have a form with a button which is supposed to open an Excel file (With lots of Macros /VBA) in it. The Excel file gets it's data from the Access program Here is the code Private Sub...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.