PARAMETERS poForm, pcFileName IF TYPE( "poForm.ole1.Name" ) # "U" poForm.ole1 = .NULL. poForm.RemoveObject( "ole1" ) ENDIF poForm.AddObject( "ole1", "oleExcel" ) poForm.Ole1.DoVerb( -2 ) define class oleExcel as oleControl OleClass = "Excel.Sheet" documentFile = "C:\TEMP\1.XLS" enddefine I get a dialog box that asks for which Ole Control I want to add, and I also get an empty sheet if I choose and Excel WorkSheet with the name of "Object".However if I do the following:
parameters pcFile oForm = createobject( "Form") oForm.AddObject( "ole1", "oleExcel" ) oForm.Ole1.DoVerb( -2 ) READ EVENTS define class oleExcel as oleControl OleClass = "Excel.Sheet" documentFile = pcFile enddefineI suppose, if the following works I can always call a hidden form and just release it when I am done editing the worksheet.