I'm running Office 2007 under Windows xp.
I have an unbound Excel chart in the detail section of an Access report. I use code to push specific fields to certain positions in the related spreadsheet. At the end of the code, I switch to the chart. When I view or print the chart, the datasheet displays. The datasheet changes from detail record to the next, as it should. I've tried other tips (Refresh and Clip), to no avail. I've placed a breakpoint on the End Sub statement and confirm that the chart is the current sheet.
Here's the essence of my code:
Dim objExcel As Excel.Application, objExcelWorkbook As Excel.Workbook
Set objExcel = Me.fraInquiries.Object.Application
Set objExcelWorkbook = objExcel.Workbooks(Me.fraInquiries.Object.Name)
With objExcelWorkbook.Sheets("datInquiries")
.Activate
.Range("B2") = intInquiryToDateGross
...and other cells...
End With
With objExcelWorkbook.Sheets("chInquiries")
.Activate
.Refresh
End With
What am I doing wrong? Why won't my chart display?
I have an unbound Excel chart in the detail section of an Access report. I use code to push specific fields to certain positions in the related spreadsheet. At the end of the code, I switch to the chart. When I view or print the chart, the datasheet displays. The datasheet changes from detail record to the next, as it should. I've tried other tips (Refresh and Clip), to no avail. I've placed a breakpoint on the End Sub statement and confirm that the chart is the current sheet.
Here's the essence of my code:
Dim objExcel As Excel.Application, objExcelWorkbook As Excel.Workbook
Set objExcel = Me.fraInquiries.Object.Application
Set objExcelWorkbook = objExcel.Workbooks(Me.fraInquiries.Object.Name)
With objExcelWorkbook.Sheets("datInquiries")
.Activate
.Range("B2") = intInquiryToDateGross
...and other cells...
End With
With objExcelWorkbook.Sheets("chInquiries")
.Activate
.Refresh
End With
What am I doing wrong? Why won't my chart display?