Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Microsoft Excel 11.0 object libary

Hi there

I am trying to make a windows form that uses excel to store some values
entered by the user. But I am having some problems with the object
libaries. The programs I use are Visual studio.net and Excel 2003

I am pretty much foloving the instructions in a book written by Michael
Halvorson (Title: Visual Basic.Net Step By Step).

The short version is that I must add a object libary to the visual
basic project to make it work with excel.
So I click the Project menu Add reference... select the COM tab
and then the book says that I must scroll down and select the Microsoft
Excel 10.0 Objevt Libary (I can see on a picture in the book that there
also is a Microsoft Excel 5.0 Object Libary).

But on my list there is Microsoft Excel 11.0 Object Libary and
Microsoft Excel 5.0 Object Libary.

So I selected the Microsoft Excel 11.0 Object Libary. But after
entering the code in the book it does not work.

Is it because of the difference between the object libaries?

I hope that some of you can help me on this

Kind regards
Anders Jensen

  #2   Report Post  
Posted to microsoft.public.excel.programming
GB GB is offline
external usenet poster
 
Posts: 230
Default Microsoft Excel 11.0 object libary

Did you try closing Excel and then reopening it? I have the 11.0 Version of
the Microsoft Excel Referenced. I also have the Microsoft Office Object
Library. As for the commands, it kind of depends on what they are. (I do
have 2 other references, OLE Automation and Visual Basic For Applications),
however I am running those from within Excel 2003, not studio like you.

" wrote:

Hi there

I am trying to make a windows form that uses excel to store some values
entered by the user. But I am having some problems with the object
libaries. The programs I use are Visual studio.net and Excel 2003

I am pretty much foloving the instructions in a book written by Michael
Halvorson (Title: Visual Basic.Net Step By Step).

The short version is that I must add a object libary to the visual
basic project to make it work with excel.
So I click the Project menu Add reference... select the COM tab
and then the book says that I must scroll down and select the Microsoft
Excel 10.0 Objevt Libary (I can see on a picture in the book that there
also is a Microsoft Excel 5.0 Object Libary).

But on my list there is Microsoft Excel 11.0 Object Libary and
Microsoft Excel 5.0 Object Libary.

So I selected the Microsoft Excel 11.0 Object Libary. But after
entering the code in the book it does not work.

Is it because of the difference between the object libaries?

I hope that some of you can help me on this

Kind regards
Anders Jensen


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Microsoft Excel 11.0 object libary

About selecting the object libary, then it is selected in Visual Basic
and not in Excel. So Excel is not open at any time.

The code the book says must be entered is (Microsoft Excel 10.0 Object
Libary):

'Decleare Excel object variables and create types
Dim xlApp As Excel.Application
Dim xlBook As Excel.Workbook
Dim xlSheet As Excel.Worksheet

xlApp = CType(CreateObject("Excel.Application"),
Excel.Application)
xlBook = CType(xlApp.Workbooks.add, Excel.Workbook)
xlSheet = CType(xlBook.Worksheets(1), Excel.Worksheet)

When I have selected the Microsoft Excel 11.0 Object Libary then the
code must be:

'Decleare Excel object variables and create types
Dim xlApp As Microsoft.Office.Interop.Excel.Application
Dim xlBook As Microsoft.Office.Interop.Excel.Workbook
Dim xlSheet As Microsoft.Office.Interop.Excel.Worksheet

xlApp = CType(CreateObject("Excel.Application"),
Microsoft.Office.Interop.Excel.Application)
xlBook = CType(xlApp.Workbooks.Add,
Microsoft.Office.Interop.Excel.Workbook)
xlSheet = CType(xlBook.Worksheets(1),
Microsoft.Office.Interop.Excel.Worksheet)

Note the difference betveen Excel.Application and
Microsoft.Office.Interop.Excel.Application

Kind regards
Anders Jensen

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default Microsoft Excel 11.0 object libary

Code that works with Excel 10 should also work with Excel 11. Either you've
made a mistake with your code, or the code you're copying has a mistake in
it (very common with books on programming). Can you post the error and the
line that causes it?



wrote in message
oups.com...
Hi there

I am trying to make a windows form that uses excel to store some values
entered by the user. But I am having some problems with the object
libaries. The programs I use are Visual studio.net and Excel 2003

I am pretty much foloving the instructions in a book written by Michael
Halvorson (Title: Visual Basic.Net Step By Step).

The short version is that I must add a object libary to the visual
basic project to make it work with excel.
So I click the Project menu Add reference... select the COM tab
and then the book says that I must scroll down and select the Microsoft
Excel 10.0 Objevt Libary (I can see on a picture in the book that there
also is a Microsoft Excel 5.0 Object Libary).

But on my list there is Microsoft Excel 11.0 Object Libary and
Microsoft Excel 5.0 Object Libary.

So I selected the Microsoft Excel 11.0 Object Libary. But after
entering the code in the book it does not work.

Is it because of the difference between the object libaries?

I hope that some of you can help me on this

Kind regards
Anders Jensen



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Microsoft Excel 11.0 object libary

For some reason it works just fine now.
I was just changing out some code to paste in my reply to GB, and now
it works :)

Nice



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Microsoft Word and Excel 11.0 Object Library ekreider Excel Discussion (Misc queries) 4 January 8th 08 04:01 PM
Microsoft Excel 11.0 Object Library documentation? Just-a-COG-in-the-works Charts and Charting in Excel 0 April 25th 07 05:22 PM
Microsoft Word Object Library in Excel Gaetan Excel Discussion (Misc queries) 4 March 14th 07 06:34 PM
Using Microsoft Excel Chart object in VB6 fizbim Charts and Charting in Excel 0 July 13th 05 05:14 PM
VB 6 Toolbar and Microsoft Excel Object 9.0 The Excel Programming 1 October 20th 03 11:18 PM


All times are GMT +1. The time now is 05:46 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"