LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.access.reports
external usenet poster
 
Posts: 4
Default Referencing Excel.Chart.8 OLE Object in Access Report

Hello All!

I have created an OLE Object in an Access report containing two Excel
Worksheets (Class = Excel.Chart.8).

The first Worksheet named [Chart] contains...well, a chart. The
second Worksheet is named [ChartData]. The chart references the data
in the [ChartData] worksheet. So far, so good. My OLE Object in the
Access report is named [oleExcelChart].

Okay...what I'm wanting to do is through VBA code, modify the
[ChartData] Worksheet in the Detail section's Print event in the
Access report, so I can dynamically change the Chart for each detail
record print.

I have some ideas on how to code this, but I can't figure out which
object (or combination of objects) to use that will accept the OLE
Object as a parameter and modify it. Here is a skeleton of what I'm
wanting to accomplish--I might be really close or totally off, but
here goes:

------------------------------------------------------------------
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
Dim xls As Excel.Application

Set xls = Me.oleExcelChart ' pass OLE Object to some Excel COM
Object

With xls
.Sheets("ChartData").Select ' select [ChartData] worksheet

' change data for three columns in first data row
.Range("A2").Select
.ActiveCell.FormulaR1C1 = "Week1"
.Range("B2").Select
.ActiveCell.FormulaR1C1 = "123"
.Range("C2").Select
.ActiveCell.FormulaR1C1 = "456"

' change data for three columns in second data row
.Range("A3").Select
.ActiveCell.FormulaR1C1 = "Week2"
.Range("B3").Select
.ActiveCell.FormulaR1C1 = "321"
.Range("C3").Select
.ActiveCell.FormulaR1C1 = "654"

' ...etc
' ...etc
End With

' maybe need some type of save method here???
xls.SomeSaveMethod

Set xls = Nothing
End Sub
------------------------------------------------------------------

Any suggestions?

Thanks!
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Exporting an Access report into Excel Stanley Excel Discussion (Misc queries) 2 November 12th 08 04:26 PM
Analyzing Access Report with Excel DoveArrow Excel Discussion (Misc queries) 4 May 28th 08 10:09 PM
How do I access to property of chart object ? HP. Jung Charts and Charting in Excel 0 April 11th 07 02:36 PM
MS OfficeLinks (from Access report to Excel) ES Excel Discussion (Misc queries) 2 January 9th 07 07:24 PM
Referencing worksheet CODENAME in a chart object. Bing Excel Discussion (Misc queries) 1 February 15th 05 01:01 AM


All times are GMT +1. The time now is 01:05 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"