Exporting Charts

J

Jerry Black

You can save the chart as a gif or jpg file. I use the
following code to do this.

DoCmd.OpenForm "FormName"
RD__Time_Delay 2000 ' Allow some time for the
chart to display properly

' If the filename ends with .gif a gif is created
' if it ends with .jpg a jpg is created
' Its like magic!

' TheChart is the name of my chart object
With Screen.ActiveForm!TheChart

' You have to do a copy/delete/paste
' or else the object server hangs up

.Action = acOLECopy
.Object.Export Filename
.Action = acOLEDelete
.Action = acOLEPaste
End With

DoCmd.Close acForm, "FormName"

My Time_Delay function just calls DoEvents the specified
number of times to create a delay.

Hope this helps.
Jerry
 

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