LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VB .NET Excel Builtin Property Access fails

I've already asked this question in the microsoft.public.dotnet.languages.vb
forum, but it has stumped them.
I wondered if anyone had tried to access/set the workbook properties using
VB .NET?

When I try it, I get the following failure when trying to access the builtin
properties;

An unhandled exception of type 'System.InvalidCastException' occurred in
resultsoutput.dll
Additional information: Specified cast is not valid.

In general terms the code is constructed as follows;

ModuleA
Public xlWb As Excel.Workbook

ModuleB
SubA
Dim prps As Microsoft.Office.Core.DocumentProperties
prps = DirectCast(xlWb.BuiltinDocumentProperties,
Microsoft.Office.Core.DocumentProperties)

This is using;
Framework 1.1
Excel 2002 SP3
Reference to COM Microsoft Excel 10.0 Object Library (Version 1.4)

I've been following the article by Ken Getz
(http://msdn.microsoft.com/library/de...-us/odc_vsto20
03_ta/html/ExcelObj.asp)
which suggests the code should work.
Ken's article refers to Excel 2003, but all the objects he references are
also in the
Microsoft Excel 10 COM object. I wondered whether this was a bug in the 2002
COM or I've missed something in my code.




 
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
How do I access to property of chart object ? HP. Jung Charts and Charting in Excel 0 April 11th 07 02:36 PM
no builtin chart options for me..(Excel 2000)!! roshinpp_77 Charts and Charting in Excel 1 June 15th 06 02:29 AM
Network access to file - read only property AL Excel Discussion (Misc queries) 1 December 2nd 04 01:22 AM
Workbook Builtin Property - display in Windows Explorer? R Avery Excel Programming 0 April 28th 04 05:38 PM
Access to class property in other workbook BenD[_2_] Excel Programming 2 March 3rd 04 09:11 AM


All times are GMT +1. The time now is 10:49 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"