Are you sure that you are not releasing the object, like oExcel,exit() or oExcel.release()? Also check if you redefine the scope somewhere in your code, like Local oExcel or Private oExcel.
I would add a break point in the debugger if Type('oExcel') changes value from O.
>Hi: I am doing excel automation but am finding some discrepancies, I think, so wanted to check out some things.
>
>1. I usually begin by making the variable that I will be using for excel, by making it public:
>
>PUBLIC oExcel
>oExcel = CreateObject("Excel.Application")
>
>
>2. Where I am beginning to encounter problems is when I refer to oExcel in procedures. For instance:
>
>
>procedure someThingForExcelToDo
> oExcel.visible = .T.
>
> oExcel = GETOBJECT("",'Excel.Application')
>endProcedure
>
>
>When automating excel, Is it too much to expect foxpro to be able to refer to public variable such as oExcel, in procedures? This is coming up because I am attempting to create a multi-tabbed excel workbook, where each procedure refers to the same excel object as it fills in a new tab.
>
>Thank you,
>Steve