Graph doesn't display in reports; data does

HartJF

Registered User.
Local time
Today, 17:44
Joined
Jul 23, 2010
Messages
34
I am running Access 2007 under Windows xp. I have embedded two Excel chart in my Access report using unbound object frames. For each chart, I added Sheet1 to store the data; Chart1 refers to that data. I have selected Chart1, formatted the chart, escaped the frame, and saved the report. I have code attached to the OnFormat event of the Detail section of the report that sets the data in Sheet1:

Dim objExcel As Excel.Application, objExcelWorkbook As Excel.Workbook, objExcelSheet As Excel.Worksheet
Set objExcel = Me.fraInquiries.Object.Application

Set objExcelWorkbook = objExcel.Workbooks(Me.fraInquiries.Object.Name)
Set objExcelSheet = objExcelWorkbook.Worksheets("Sheet1")
With objExcelSheet
.Activate
.Range("B2") = intInquiryToDateGross
.Range("C2") = intInquiryToDateElevated
.Range("D2") = intApplicationToDateTotal
.Range("B3") = intInquiryNeededGross
.Range("C3") = intInquiryNeededElevated
.Range("D3") = intApplicationNeededTotal
End With
With objExcelWorkbook.Sheets("Chart1")
.Activate
.Refresh
End With

Set objExcelWorkbook = objExcel.Workbooks(Me.fraApplicants.Object.Name)
Set objExcelSheet = objExcelWorkbook.Worksheets("Sheet1")
With objExcelSheet
.Activate
.Range("B2") = intApplicationToDateTotal
.Range("C2") = intApplicationToDateAcceptance
.Range("D2") = intApplicationToDateDeposit
.Range("E2") = intApplicationToDateOfficial
.Range("B3") = intApplicationHistoricalTotal
.Range("C3") = intApplicationHistoricalAcceptance
.Range("D3") = intApplicationHistoricalDeposit
.Range("E3") = intApplicationHistoricalOfficial
.Range("B4") = intApplicationNeededTotal
.Range("C4") = intApplicationNeededAcceptance
.Range("D4") = intApplicationNeededDeposit
.Range("E4") = intApplicationNeededOfficial
End With
With objExcelWorkbook.Charts("Chart1")
.Activate
.Refresh
End With

My problem is that the datasheet displays, not the chart. I tried to activate the charts using different objects to no avail. At a break on each Refresh statement, I confirm that Chart1 is the active sheet, but it does not display. The data is correctly updated for each detail record. I have no other code in the report.

What have I done wrong?
 

Users who are viewing this thread

Back
Top Bottom