Export Chart from Report

J

Jason Lopez

I have read on a few web pages on how to export a PivotChart to Excel and
even save it as a file. However, I can't get it to work. I have this code
below that supposedly works.

Private Sub Form_Activate()

Dim frm As Access.Form 'your form
Dim FileName As String 'a local variable to contain the user's choice of
file name

FileName = ShowSaveFileDialog("*.jpeg") 'assign the local variable the
return result of the ShowSaveFileDialog function

Set frm = Me.mFrm_Graph01.Form
frm.ChartSpace.ExportPicture FileName, "jpeg"

End Sub

When I run it, it doesn't work. When I edit the code to read below, it will
run but won't save a file.

Private Sub Form_Activate()

Dim frm As Access.Form 'your form
Set frm = mFrm_Graph01.Form
frm.ChartSpace.ExportPicture "graph01.jpg", "jpeg"

End Sub

I'm confused as to how this works and why it is not saving despite other
people getting it to work. I have checked throughout my entire hard drive
for the "graph01.jpg" file and it is not there. There was even a posting
that I saw that you can use the system object to verify that it saved
correctly. I would love to have that. But have no clue how to implement
that or where to begin.

Help?

Jason
 

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