Embedding Excel chart in Access report

HartJF

Registered User.
Local time
Today, 07:29
Joined
Jul 23, 2010
Messages
34
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?
 
A quick question.

Is your database saved as the version of Access you are using? Charts don't seem to like it if the database is saved to a previous version, that maybe one thing to look at.
 
Thank you for responding, Trevor.

Yes, the database file is in Access 2007 (.accdb) format.
 

Users who are viewing this thread

Back
Top Bottom