Terry,
If Excel is terminating it's because your oExcel object went out of scope and took the Excel app with it. If you are doing this from a .prg you probably need a PUBLIC variable or at least one scoped higher than the prg. Personally I'd use an object property to hold the reference.
It works in the command window because you effectively have created a public memvar oExcel that doesn't go out of scope until you release it or reassign it.
>Hello!
>From the command window:
>OExcel.Visible=.t.
>Will open an excel session. Excel remains open until close is clicked.
>
>However, inside a PRG, the Excel window flashes on and off, and process returns (immediately) to VFP. Is there a timer/API method that could be processed by VFP to prevent Excel from immediately closing when the ole call is issued from inside a PRG?