>Dan,
>
>I am not sure what you mean. The code to Add the object to the form is is the forms init event. When it talks about passing the parameters to the INIT event, which object's INIT method is it talking about? the form or the new object.
>
>Also, what is AFAIK?
>
>Thanks
>Becky
Ok, here's the solution I've come up with. It's a kludge but unfortunately the OleControl is very picky about when you can assign the file name. In your form you can call the code below in a prg and just pass it the file name. You may want to release oForm again when you close the form.
HTH
#DEFINE knEdit -2
PARAMETERS pcFile
RELEASE oForm
PUBLIC oForm
oForm = createobject( "Form")
oForm.AddObject( "oleObject", "oleExcel" )
oForm.OleObject.DoVerb( knEdit )
DEFINE CLASS oleExcel as OleControl
OleClass = "Excel.Sheet"
DocumentFile = pcFile
ENDDEFINE