>>>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.