Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Adding an OLE container object to a form
Message
From
06/10/1999 19:17:31
 
 
To
06/10/1999 14:57:32
Becky Vidal
Heritage Information Systems, Inc.
Richmond, Virginia, United States
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00273310
Message ID:
00273458
Views:
33
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform