Try to follow the Workbooks.OPen syntax. Here it is for Excel2002:
expression.Open(FileName, UpdateLinks, ReadOnly, Format, Password,;
WriteResPassword, IgnoreReadOnlyRecommended, Origin, Delimiter, Editable, ;
Notify, Converter, AddToMru, Local, CorruptLoad, OpenConflictDocument)
See there IgnoreReadOnlyRecommended parameter? Set it to .t.
For your Excel version 97 the syntax may be slightly different, so, check it in Excel VBA Help if the above does not work for you.
>Hi All,
>
>I'm automating Excel with Foxpro to open a excel 97 workbook,when opening it prompts a message if I want to open it in "edit" mode or "read" mode. How to supress the prompt and choose always for edit. I have somewhat the following code:
>
>
>oExcel = CreateObject("Excel.Application")
>oExcel.Workbooks.Open("f:\restposten.xls")
>
>
>try to change
>oExcel.DisplayAlerts = .F.
>oExcel.Application.Workbooks.Open("f:\restposten.xls")