Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

embedding OLE object error

Status
Not open for further replies.

KellyK

Programmer
Mar 28, 2002
212
US
Hello - I have run into a situation which is triggering run-time error 2790, stating that I cannot embed an OLE object if the OLETypeAllowed is set to Linked. Here is my code which I am clearly setting the type to "Embedded":

Code:
oleChart.OLETypeAllowed = OLE_EMBEDDED
oleChart.Class = "jpegfile"
oleChart.SourceDoc = txtProjDir & "\chart.jpg"
oleChart.Action = acOLECreateEmbed
oleChart.Action = acOLEActivate

When I go back into the design of the OLE frame on my form, the OLE Type Allowed keeps going back to "Linked" even though I am changing it to Embedded. Any ideas?

Kelly
 
Are you using an unbound object frame? Are you adding items to the database? Linking is generally a better option for images. [ponder]
 
I am using a bound object frame which references an OLE field in a table. I want to insert the image into the table. I have read that linking is a better option, but I would like to try to get this to work because I'm not sure how long the images will be saved to the network. Thanks!

Kelly
 
Try:
Me.oleChart.OLETypeAllowed = acOLEEmbedded
Me.oleChart.Class = "jpegfile"
Me.oleChart.SourceDoc = txtProjDir & "\chart.jpg"
Me.oleChart.Action = acOLECreateEmbed
Me.oleChart.Action = acOLEActivate
 
Thanks, Remou. Now I am getting run-time error '2793': Microsoft Access can't perform the operation specified in the Action property of the Visual Basic procedure you're trying to run, on the line: Me.oleChart.Action = acOLECreateEmbed.


Kelly
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top