Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel 11 Type library for VB.NET?

Dear Friends,

I'm developing a VB.NET 2005 project in windows VISTA.

I add reference to Excel 11 (2003) type library.

My reference seems to be made to Excel.exe and declaration appears as below:

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

but it returns exception when I try to cast excel into it as below:

myExcel = GetObject(, "Excel.Application") or myExcel = GetObject(,
"Excel.Application.11")


If I change my delaration to

Dim myExcel As Object

everything goes well for a while but I cannot access most of Excel object
library's properties (such as Activeworksheet.cells(2,2).value) which were
all visible to me in VB6.

Any help would be highly appreciated.

Kind Regards,
M. Ramezani

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 857
Default Excel 11 Type library for VB.NET?

Hi,

Try something like this. It will create a new workbook and save it in the
root of drive C:.

Dim myExcel As New Microsoft.Office.Interop.Excel.Application
Dim wb As Microsoft.Office.Interop.Excel.Workbook

wb = myExcel.Workbooks.Add()
wb.SaveAs("C:\test.xls")
wb.Close()
myExcel.Quit()


--
Hope that helps.

Vergel Adriano


"Mansour" wrote:

Dear Friends,

I'm developing a VB.NET 2005 project in windows VISTA.

I add reference to Excel 11 (2003) type library.

My reference seems to be made to Excel.exe and declaration appears as below:

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

but it returns exception when I try to cast excel into it as below:

myExcel = GetObject(, "Excel.Application") or myExcel = GetObject(,
"Excel.Application.11")


If I change my delaration to

Dim myExcel As Object

everything goes well for a while but I cannot access most of Excel object
library's properties (such as Activeworksheet.cells(2,2).value) which were
all visible to me in VB6.

Any help would be highly appreciated.

Kind Regards,
M. Ramezani

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
My Type Library is not complete [email protected] Excel Programming 4 November 28th 07 12:21 AM
Date type library madeleine[_2_] Excel Programming 5 November 24th 06 10:58 AM
Missing Type Library Daves_Solutions Excel Programming 2 April 12th 06 04:09 PM
Type Library Reference Mark[_63_] Excel Programming 1 April 10th 06 03:46 AM
TYPE Library issues. shishi Excel Programming 1 August 19th 05 07:11 PM


All times are GMT +1. The time now is 02:41 PM.

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

About Us

"It's about Microsoft Excel"