Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Get OLEObject with CSharp | Excel Programming | |||
OLEObject GetFocus | Excel Programming | |||
OLEObject on worksheet. Trying to get value from it. | Excel Programming | |||
Need to cast OleObject to CombBbox | Excel Programming | |||
OLEobject on the sheet | Excel Programming |