>Hi
>
>With a lot of help from Cetin Basov I have managed to get VFp to populate an existing Excel spreadsheet. It works fine on one machine running Win2k prof sp5, VFP6 sp5 Office 2000 but not on others with a similar spec. If I run it on a machine which has Excel 97 instad of Excel 2000 it works fine otherwise I get the message
>
>OLS is not an object.
>
>The code is
>
>this._webBrowser41.Navigate2('file://j:\global\mertest.xls')
>oXLS = thisform._webbrowser41.object.document
>oExcel = oXLS.Application
>
>Paths are correct. Dcom permissions are OK
>
>Any bright ideas?
>
>Thanks
>
>Colin
Colin,
Reproduced :) Guess what. I was directly using Shell.Explorer. When I tried it with _WebBrowser4 from FFC (yes I know I suggested:) I got the same error ! document was .null.
I created a test form, dropped a web browser control from 'Activex controls' and a button. Codes are below. It worked but I got the error everytime I tried with FFC webbrowser. I never checked in depth what FFC version does. Probably a property setting or method would do there too.
nodefault
lcXLSFile = Sys(5)+Curdir()+'myTest.xls'
With thisform.OleControl1
.Navigate2('file://'+lcXLSFile)
Do While .ReadyState # 4
EndDo
endwith
oXLS = thisform.OleControl1.object.document
oExcel = oXLS.Application
oExcel.ActiveWorkbook.ActiveSheet.Range('A:B').Interior.ColorIndex = 3
Cetin