Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to assure Excel on top
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00826248
Message ID:
00826535
Views:
20
>>>A project with some automation generates charts. In cases were the values are zero, the user wants a message. Without the messagebox, when oExcel becomes visible, the Excel application is on top of the VFP interface. Thats what I want.
>>>
>>>However, when the messagebox is called and closed, then oExcel is behind the VFP form? Is there an easy way to assure that Excel will be on top after the mesaagebox is closed?
>>>
>>>Thanks
>>
>>oEx = CREATEOBJECT("Excel.application")
>>oEx.Visible=.t.
>>* click on VFP window
>>nHwnd = oEx.Hwnd
>>DECLARE INTEGER SetForegroundWindow IN user32 INTEGER hwnd
>>SetForegroundWindow(nHwnd)
>
>VFP ON ERROR reports an unknown name (800200006) error on "nHwnd = oEx.Hwnd"

What version of Excel? Hwnd is on Excel2002. I don't have any other version of Excel installed that I can check.
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform