PIA of Microsoft Office 2003

  • Thread starter Thread starter ©pEIO
  • Start date Start date
©

©pEIO

I have installed the PIA of Microsoft Office 2003 and the installation was
succefully.
If I add the reference of Microsoft Excel 11.0, I see that the property
CopyLocal is False
and the assembly linked is

C:\WINDOWS\assembly\GAC\Microsoft.Office.Interop.Excel\11.0.0.0__71e9bce111e
9429c\Microsoft.Office.Interop.Excel.dll

But if I try to use the the assembly, I see that the object Range are
declared Object and not
Excel.Range... I can't see the method and the property of the object.
Also the example on the Microsoft's site
http://msdn.microsoft.com/library/default.asp?url=/library/enus/dnoxpta/html/odc_oxppias.asp
can't be compiled because the istruction

strRow = strRow & objRange.Cells(intRow, intCell).value & vbTab

say me that Option Strict can't convert the type Object into Excel.Range...

Thanks. Ciao.
pEIO
 
Hi Pieo

You need to use DirectCast something like this

DirectCast(objBook.Sheets
("English"),Excel.Worksheet).Activate()

Kind Regards
Jorge
 
Jorge said:
Hi Pieo

You need to use DirectCast something like this

DirectCast(objBook.Sheets
("English"),Excel.Worksheet).Activate()

Kind Regards
Jorge
I know that maybe possible use the direct cast but this don't work...
This istruction return an exception something like this:

"Invalid cast from Object to Worksheet"

Thanks. Ciao.
pEIO
 
* "©pEIO said:
I have installed the PIA of Microsoft Office 2003 and the installation was
succefully.
If I add the reference of Microsoft Excel 11.0, I see that the property
CopyLocal is False
and the assembly linked is

C:\WINDOWS\assembly\GAC\Microsoft.Office.Interop.Excel\11.0.0.0__71e9bce111e
9429c\Microsoft.Office.Interop.Excel.dll

Sure you set the reference on the "COM" tab?
 
Hi Peio

It was just an example, try one the following :


strRow = strRow & directcast(objRange.Cells(intRow,
intCell), excel.range).value & vbTab

strRow = strRow & directcast(objRange, excel.range).Cells
(intRow, intCell).value & vbTab

Kind Regards
Jorge
 
Jorge said:
Hi Peio

It was just an example, try one the following :


strRow = strRow & directcast(objRange.Cells(intRow,
intCell), excel.range).value & vbTab

strRow = strRow & directcast(objRange, excel.range).Cells
(intRow, intCell).value & vbTab

Kind Regards
Jorge

Thanks... I have try this but don't work.....
It's very very strange...

Ciao.
pEIO
 
Back
Top