Excel chart -> Access: help please!

D

Dave Stone

Posts to Access, Excel, and this newsgroup have not elicited a single
suggestion, and I am really running out of ideas to try. The best info I
have on using unbound object frames suggests that the Class, OLETypeAllowed,
SourceDoc, SourceItem, SizeMode, and Action properties are the ones to set,
and I have tried this, but the Excel chart in question does not appear. In
fact, assigning to the Action property gives an error 2793 'MS Access cannot
perform the operation specified in the Action property'. Maybe this is due
to trying to set the frame properties in the Detail section's OnPrint event
proc. Currently what I have is:

Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)

On Error GoTo Err_Detail_Print

If FormatCount = 1 Then
OLEUnbound21.Class = "Excel.Chart" ' Set class name.
' Specify type of object.
OLEUnbound21.OLETypeAllowed = acOLEEither
' Specify source file.
OLEUnbound21.SourceDoc = "C:\\example.xls"
' Specify data to create link to.
OLEUnbound21.SourceItem = "Chart1"
' Create linked object.
OLEUnbound21.Action = acOLECreateEmbed
' Adjust control size.
OLEUnbound21.SizeMode = acOLESizeStretch
' MsgBox "GRUPO_ESPECIES = " & Me![grupo_especies]
End If
<error handler omitted>
End Sub

Hope someone can suggest what's wrong. I feel sure this must be a technique
used fairly often, given that Excel charts are so much more flexible than
Access'.

Dave


--
************************************************************************
Dave Stone e-mail: (e-mail address removed)
Computing Services Telephone: +44 131-650-3314
University of Edinburgh Internal ext: 503314
Main Library, George Square FAX: 0131-650-3308
Edinburgh EH8 9LJ
************************************************************************
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top