Hello,
I would like to export an Access Chart to Excel using VBA code.
Most specifically, I have a form that shows some data that is obtained from a query.
In that same form there is a chart that graphs out the query.
What I want to do, is to export the query and it's associated chart by using a form button with VBA code.
The query export process is easy.
For that I used the following code:
Code:
Private Sub Command00_Click()
On Error GoTo Err_Command00_Click
Dim Output1 As Integer
DoCmd.Requery
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12, "Query1", "DB_Export", True
Output1 = MsgBox("DB exported successfully!", vbOKOnly, "")
Exit_Command00_Click:
Exit Sub
Err_Command00_Click:
MsgBox Err.Description
Resume Exit_Command00_Click
End Sub
Now, what code should I include to export the chart as well?
If it's not possible to export the chart (as a chart element), how can I export the chart as a JPEG into the Excel file "DB_Export.XLSB" that is created with the code provided above?
Excel File Name = DB_Export.XLSB
Excel Worksheet Name = Sheet1
Access Chart Name=Chart1
Thank you kindly