By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,472 Members | 2,195 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,472 IT Pros & Developers. It's quick & easy.

Embedded Excel Chart

P: n/a
Does anyone know how to change the datasource of an Embedded Excel
chart in an unbound Object Frame.

How to reference the properties??

I want to do something like this.

Dim XLChart as object

XLChart.SetSourceData Source:=Sheets("worksheets(1)").Range ("B3:H5"),
PlotBy:=xlRows

and then change it's Title

XLChart.worksheets(1).ChartObjects("Chart
1").ChartArea.Select.HasTitle = True
XLChart.worksheets(1).ChartObjects("Chart
1").ChartArea.Select.ChartTitle.Characters.Text = "My Title"

Regards

Gary

Nov 13 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Hi All,

Can this be done??

Controlling the properties of a chart within an unboumd object frame -
embedded excel worksheet??

Regards

Gary

Nov 13 '05 #2

P: n/a
Hi All,

Can this be done??

Controlling the properties of a chart within an unboumd object frame -
embedded excel worksheet??

Regards

Gary

Nov 13 '05 #3

P: n/a

ghanley wrote:
Hi All,

Can this be done??

Controlling the properties of a chart within an unboumd object frame -
embedded excel worksheet??

Regards

Gary


I've controlled normal chart properties, but not within an unbound
object frame. Can you do it manually while recording an Excel macro?

James A. Fortune

Nov 13 '05 #4

P: n/a

ghanley wrote:
Hi All,

Can this be done??

Controlling the properties of a chart within an unboumd object frame -
embedded excel worksheet??

Regards

Gary


I've controlled normal chart properties, but not within an unbound
object frame. Can you do it manually while recording an Excel macro?

James A. Fortune

Nov 13 '05 #5

P: n/a
Yes - I have manage to run a Macro recording - and I end up with this
ActiveChart.SetSourceData Source:=Sheets("Query3").Range("B3:D8"),
PlotBy:= xlColumns

My problem now is converting this to VB that Access understands because
I need it to be dynamic as the recordsource changes from form criteria.

The only reason for me trying to manipulate the datasource - is because
the legend needs to be updated when the record count changes.

If there are fewer data series being plotted - the legend shows empty
entries.

Hope this makes sence??

GAry

Nov 13 '05 #6

P: n/a
ghanley wrote:
Yes - I have manage to run a Macro recording - and I end up with this
ActiveChart.SetSourceData Source:=Sheets("Query3").Range("B3:D8"),
PlotBy:= xlColumns

My problem now is converting this to VB that Access understands because
I need it to be dynamic as the recordsource changes from form criteria.

The only reason for me trying to manipulate the datasource - is because
the legend needs to be updated when the record count changes.

If there are fewer data series being plotted - the legend shows empty
entries.

Hope this makes sence??

GAry


Here's how I change the labels on 12 charts from Access that each take
up a sheet in Excel:

'Chart Labels
For lngI = 1 To 12
objXL.Sheets(ChartSheetName(lngI)).Select
objXL.ActiveChart.ChartTitle.Select
objXL.Selection.Characters.Text = strNewTitle(lngI)
objXL.Selection.AutoScaleFont = False
With objXL.Selection.Characters(Start:=1,
Length:=Len(strNewTitle(lngI))).Font
.Name = "Arial"
.FontStyle = "Bold"
.Size = 12
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = 11
End With
Next lngI
Obviously my objXL.Sheets(ChartSheetName(lngI)).Select won't work in
your case. Maybe recording a macro that just selects the chart will
show you what to use in place of this line. Once you can reference
ActiveChart, SetSourceData may become available for it also. Also, I
like starting from objXL for references (including Sheets) so that I
don't have any problems closing the spreadsheet. Plus, make sure you
have a reference to the Excel Object Library. Except for referencing
objXL, the syntax should be identical.

James A. Fortune

Nov 13 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.