Cetin:
I gave it a try, and still Page Fault. Maybe its due to switches in the "Auto_start" macro. I tried something, and was able to get around page fault:
Originally:
oExcel=CREATEOBJECT('Excel.Application')
oExcel.Application.WorkBooks.WorkSheet.Open('MyXLS.xls')
oExcel.Application.Run("Auto_Open")
oExcel.Visible=.t.
* With this sequence, clicking the WorkSheet (X)Close caused GPF
Current WorkAround:
oExcel=CREATEOBJECT('Excel.Application')
oExcel.Application.WorkBooks.WorkSheet.Open('MyXLS.xls')
oExcel.Visible=.t. && Note the visible is before the "Auto_Open" macro
oExcel.Application.Run("Auto_Open") && The user sees a sluggish macro execute
* With this sequence, clicking the WorkSheet (X)Close did not cause GPF
:Questions
1) Why doesn't .Run("Auto_Open") execute with the .Open("MyXLS.xls")?
2) Does re-sequencing of Visible say anything about the macro that may help?
3) Can I disable the (X)Close button on the WorkSheet?
4) Can I disable the (-) Minimize and Maximize Buttons on Excel's main?
Also, I note that I used the form:
oExcel.WorkBooks.Open('MyXLS.xls') in my original message
rather than:
oExcel.Application.WorkBooks.WorkSheet.Open('MyXLS.xls')
* Is there a difference?
Since I'm new to VFP Excel Automation, I don't have a solid understanding of whats really going on. An automation newbie!
Thanks
Terry
Imagination is more important than knowledge