Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
hello everyone,
how do i click a commandbutton using .net and the Excel 11.0 Object Library this is my code, but the error says it cannot cast system.__comobject to the excel.oleobjectclass Microsoft.Office.Interop.Excel.Application appExcel = new Microsoft.Office.Interop.Excel.Application(); ", Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing); Microsoft.Office.Interop.Excel.Worksheet wsSetup = (Microsoft.Office.Interop.Excel.Worksheet)appExcel .Sheets["Sheet1"]; Microsoft.Office.Interop.Excel.OLEObjectClass objRefresh = (Microsoft.Office.Interop.Excel.OLEObjectClass)wsS etup.OLEObjects("CommandButton1"); //After casting it i guess i want to call the click method //objRefresh.Click() or something string strType = objRefresh.OLEType.ToString(); appExcel.ActiveWorkbook.Close(false, Type.Missing, Type.Missing); appExcel.Quit(); MessageBox.Show(strType); thank you for your help |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Customizing right-click button | Excel Discussion (Misc queries) | |||
Create floating button based on button click in menu | Excel Programming | |||
On Button Click(Help!) | Excel Programming | |||
VBA button click need help. Need LEN help. | Excel Programming | |||
VBA button click need help. Need LEN help. | Excel Programming |