I've got a simple database in Access 2007, part of which creates a pivotchart. I would like to export the chart (preferably into Excel, but I could also accept a jpg or gif file). I've tried the M$ site suggestions:
Me.PivotTable.Export stDocName, plExportActionOpenInExcel
or
Me.ChartSpace.ExportPicture "D:\PivotChart.gif", , 1024, 1024
However, with both of these I get the following message:
"The expression you entered refers to an object that is closed or doesn't exist."
Do any of the learned minds here have any suggestions as to how to fix this problem. Any help would be greatly appreciated.
My code for the procedure is:
Me.PivotTable.Export stDocName, plExportActionOpenInExcel
or
Me.ChartSpace.ExportPicture "D:\PivotChart.gif", , 1024, 1024
However, with both of these I get the following message:
"The expression you entered refers to an object that is closed or doesn't exist."
Do any of the learned minds here have any suggestions as to how to fix this problem. Any help would be greatly appreciated.
My code for the procedure is:
Private Sub Chart2XL_Click()
On Error GoTo Err_Chart2XL_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Data Chart"
DoCmd.OpenForm stDocName, acFormPivotChart, "", "", , acNormal
Me.PivotTable.Export stDocName, plExportActionOpenInExcel
Exit_Chart2XL_Click:
Exit Sub
Err_Chart2XL_Click:
MsgBox Err.Description
Resume Exit_Chart2XL_Click
End Sub