Embed Excel Chart in Access Unbound Object Frame using a filepath (1 Viewer)

RichBLACKIII

New member
Local time
Today, 12:17
Joined
Aug 5, 2010
Messages
5
I can't seem to figure out how to reference a chart through its filepath to embed in my Access form in an Unbound Object Frame. I need to reference several charts from different worksheets and embed them also, so I need to figure out how reference them via their filepath name. Here is an example of the code that's not working

With dtb
.Visible = True
' Enable control.
.Enabled = True
' Set Locked property to False.
.Locked = False
' Allow embedded objects only.
.OLETypeAllowed = acOLEEmbedded
' Specify the OLE server and the type of object.
.Class = "Excel.Chart.8"
' Specify the file to be embedded.
.SourceDoc = "G:\000_Supply Chain\Procurement-Corporate\Spend Management\Spend Management 7-19-2010.Sheets("Direct-Charts").ChartObjects("Chart 35").Chart"
' Create the embedded object.
.Action = acOLECreateEmbed
End With


The ".SourceDoc =...." part is the non working part. Thanks for the help in advance !!!
 

annasmalik

New member
Local time
Today, 09:17
Joined
Aug 9, 2019
Messages
1
I'm a novice to VBA but, Did you try using forward slashes or double backslash in the quoted file path?



Some programming languages use the single backslash as an escape character within quoted strings which needs a double backslash to return one backslash.



Microsoft also recognizes the forward slash as a folder delimiter. The single backslash is a Unix convention.
 

Users who are viewing this thread

Top Bottom