Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Get OLEObject.Object with Csharp

Hi,

I want to change the Value and BackColor of all OLEObjects from my xls files
(more than 1000 files), BUT how can I cast to a specific type
(Excel.OLEObject.Object is object ype in Csharp) ??

:
using Excel = Microsoft.Office.Interop.Excel;

Excel.Application excelApp = new Excel.Application();

Excel.Workbook wrkBook = excelApp.Workbooks.Open(file, Type.Missing,
Type.Missing, Type.Missing, ... , Type.Missing) ;

Excel.Worksheet wrkSheet = (Excel.Worksheet)wrkBook.Worksheets[1];

Excel.OLEObjects oleObjects =
(Excel.OLEObjects)wrkSheet.OLEObjects(Type.Missing );

foreach(Excel.OLEObject oleObject in oleObjects)
{
oleObject.Enabled = true;
//oleObject.Object is type object. How can I access Value property ?
}

Thanks for any advice



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
Get OLEObject with CSharp Bragadiru Excel Programming 0 November 2nd 04 03:31 PM
OLEObject GetFocus Erich Neuwirth Excel Programming 1 August 11th 04 08:18 PM
OLEObject on worksheet. Trying to get value from it. Grant Excel Programming 4 August 9th 04 06:00 AM
Need to cast OleObject to CombBbox Liline Excel Programming 1 August 29th 03 03:32 PM
OLEobject on the sheet Ryan[_6_] Excel Programming 1 August 3rd 03 03:15 PM


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