Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
how to get hwnd from application object?
Hi: I am using Excel from another app using COM/OLE. I need to bring the Excel window to the foreground. Is there any way to the hWnd from the Application object? Now I use the FindWindow API call to find the Excel window but that is not foolproof. Thanks, Erwin ---------------------------------------------------------------- Erwin Kalvelagen GAMS Development Corp., http://www.gams.com , http://www.gams.com/~erwin ---------------------------------------------------------------- |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
how to get hwnd from application object?
Erwin,
In Excel 2002 and later, you can get the hWnd property directly from the Application object. E.g., Dim XLHWnd As Long XLHWnd = Application.Hwnd In earlier versions, you need to use FindWindow on "XLMAIN". -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Erwin Kalvelagen" wrote in message ... Hi: I am using Excel from another app using COM/OLE. I need to bring the Excel window to the foreground. Is there any way to the hWnd from the Application object? Now I use the FindWindow API call to find the Excel window but that is not foolproof. Thanks, Erwin --------------------------------------------------------------- - Erwin Kalvelagen GAMS Development Corp., http://www.gams.com , http://www.gams.com/~erwin --------------------------------------------------------------- - |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
how to get hwnd from application object?
Ah, great, that explains it. I am running good old Excel 2000. Thanks for the explanation! -- ---------------------------------------------------------------- Erwin Kalvelagen GAMS Development Corp., http://www.gams.com , http://www.gams.com/~erwin ---------------------------------------------------------------- "Chip Pearson" wrote in message ... Erwin, In Excel 2002 and later, you can get the hWnd property directly from the Application object. E.g., Dim XLHWnd As Long XLHWnd = Application.Hwnd In earlier versions, you need to use FindWindow on "XLMAIN". -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Erwin Kalvelagen" wrote in message ... Hi: I am using Excel from another app using COM/OLE. I need to bring the Excel window to the foreground. Is there any way to the hWnd from the Application object? Now I use the FindWindow API call to find the Excel window but that is not foolproof. Thanks, Erwin --------------------------------------------------------------- - Erwin Kalvelagen GAMS Development Corp., http://www.gams.com , http://www.gams.com/~erwin --------------------------------------------------------------- - |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Application/Object defined error? | Excel Discussion (Misc queries) | |||
cannot start the source application for this object | Excel Discussion (Misc queries) | |||
CANNOT START THE SOURCE APPLICATION FOR THIS OBJECT | New Users to Excel | |||
Cannot start the source application for this object | Excel Discussion (Misc queries) | |||
"Excel.Application" Object Model | Charts and Charting in Excel |