>I agree with Cetin in that it is not a good practice to use global variables. Rather I use a property attached to _VFP system object as follows:
>
>
>ADDPROPERTY(_VFP, "oExcel", CreateObject("Excel.Application"))
>
>
>Now you can use the assignment anywhere as _VFP.oExcel
In case you didn't notice, Cetin also wrote "or a property of a public object". IOW, he recommends to NOT use your solution.