M
Marie via AccessMonster.com
Using Access 2000 I am trying to export Access query results to Excel where
I would like to create a chart. I would then like to import the chart into an
Access report.
The query and export section of the following code is working. The query
result appears in Excel, however the macro I have created in Excel does not
create the chart. When I run the macro in Excel it does create the chart and
copies it to the clipboard, but there seems to be a disconnect somewhere in
the code. I am receiving an "Object Required" message. I am not sure which
object it is referring to.
Sub PreviewChart_Click()
On Error GoTo Err_PreviewChart_Click
DoCmd.OpenQuery "qryMakeTableXXX", acNormal, acEdit
DoCmd.TransferSpreadsheet acExport, 8, "TableXXX", "c:\Cases\XXXChart",
True, ""
objExcel.Application.Run "PERSONAL.XLS!XXXChart"
DoCmd.OpenReport "rptXXXChart", acDesign, "", ""
DoCmd.RunCommand acCmdPaste
Exit_PreviewChart_Click:
Exit Sub
Err_PreviewChart_Click:
MsgBox Err.Description
Resume Exit_PreviewChart_Click
End Sub
I am new to coding and not sure if the code I have created is the best way to
accomplish the task.
I would prefer to create the charts in Excel as I find them much easier and
more flexible than Access charts.
Any help would be greatly appreciated!
Thanks in advance,
Marie
I would like to create a chart. I would then like to import the chart into an
Access report.
The query and export section of the following code is working. The query
result appears in Excel, however the macro I have created in Excel does not
create the chart. When I run the macro in Excel it does create the chart and
copies it to the clipboard, but there seems to be a disconnect somewhere in
the code. I am receiving an "Object Required" message. I am not sure which
object it is referring to.
Sub PreviewChart_Click()
On Error GoTo Err_PreviewChart_Click
DoCmd.OpenQuery "qryMakeTableXXX", acNormal, acEdit
DoCmd.TransferSpreadsheet acExport, 8, "TableXXX", "c:\Cases\XXXChart",
True, ""
objExcel.Application.Run "PERSONAL.XLS!XXXChart"
DoCmd.OpenReport "rptXXXChart", acDesign, "", ""
DoCmd.RunCommand acCmdPaste
Exit_PreviewChart_Click:
Exit Sub
Err_PreviewChart_Click:
MsgBox Err.Description
Resume Exit_PreviewChart_Click
End Sub
I am new to coding and not sure if the code I have created is the best way to
accomplish the task.
I would prefer to create the charts in Excel as I find them much easier and
more flexible than Access charts.
Any help would be greatly appreciated!
Thanks in advance,
Marie