Terence, here’s some code that works for me:
I deleted out some extraneous stuff so this is the gist.
Set appexcel = CreateObject("Excel.Application")
With appexcel strDBPath = Left(strDBPath, intSlashLoc) & Automation\ReceivedVsClosed.xls"
.Workbooks.Open strDBPath
.Sheets("Chart").select
.activechart.ChartArea.select
.activechart.HasTitle = True
.activechart.ChartTitle.characters.Text = strProgram
.activechart.seriescollection(1).XValues = "=Data!R1C" & _
CStr(intColBeg) & ":R1C" & CStr(intColEnd)
.activechart.seriescollection(1).values = "=Data!R4C" & _
CStr(intColBeg) & ":R4C" & CStr(intColEnd)
.activechart.seriescollection(2).XValues = "=Data!R1C" & _
CStr(intColBeg) & ":R1C" & CStr(intColEnd)
.activechart.seriescollection(2).values = "=Data!R5C" & _
CStr(intColBeg) & ":R5C" & CStr(intColEnd)
.activechart.seriescollection(3).values = "=Data!R6C" & _
CStr(intColBeg) & ":R6C" & CStr(intColEnd)
Set appexcel = Nothing
From: MS_Access_Professionals@yahoogroups.com [mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of Terence Lepczyk
Sent: Thursday, February 27, 2014 6:37 PM
To: MS_Access_Professionals@yahoogroups.com
Subject: RE: [MS_AccessPros] ms access 2007 form with graph object
Sort of.
The excel macro generated code used the nomenclature of activechart, I therefore assumed I could replace Activechart with Me![Graph94].Object.Application.Chart
That seemed to work for "hasTitle" and ChartTitle.text
It failed when I attempted the line .Axes(xlCategory, xlPrimary).HasTitle = True
almost as though there was no value for XlCategory and/or XlPrimary
Terence
***************code
Dim GraphObj As Object
Set GraphObj = Me![Graph94].Object.Application.Chart
With GraphObj
.HasTitle = True
.ChartTitle.Text = "Awesome Chart Title"
.Axes(xlCategory, xlPrimary).HasTitle = True
' .Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text = "Log (Time)"
' .Axes(xlValue, xlPrimary).HasTitle = True
' .Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = "Load * Time"
End With
This email (and all attachments) is for the sole use of the intended recipient(s) and may contain privileged and/or proprietary information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message.
Reply via web post | Reply to sender | Reply to group | Start a New Topic | Messages in this topic (4) |
Tidak ada komentar:
Posting Komentar