473,406 Members | 2,867 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Embedded Excel Chart

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
6 5653
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
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

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

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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: ghanley | last post by:
I have searched the web all day for a lead on this. I have found how to control the Graph object mut not the embedded excel unbound object frame. I am trying to chart the data below on one...
0
by: ghanley | last post by:
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...
1
by: Robin Tucker | last post by:
Heres and interesting problem: I have a VB.NET program that creates reports via. Word Automation. This all works fine. What I want to do as part of this report generation process is to embed a...
1
by: Randall Arnold | last post by:
I'm converting a vbscript program to vb.net. Witht he exception of .net idiosyncrasies, most of it is working well with the same code. My only problem is that some properties and methods are...
0
by: pmclinn | last post by:
The code below takes the data from the S column and grabs all the data and graphs it. The problem is this example grabs 500 cells worth of data and some of these cells = nothing. How do I rescope...
0
by: rdemyan via AccessMonster.com | last post by:
I am at my wit's end with the MS Graph object that can be placed on a form. I need to change the Chart type of multiple series of data. I need to control other properties as well. I'm fairly...
0
by: madhatter84gn | last post by:
I am trying to automate an excel spreadsheet and then create a chart. Dim chartRange As Excel.Range If rollup Then chartRange = sheet.Range("O2:Q14", Type.Missing) ...
8
by: j2flk1234 | last post by:
Hi, I have a chart that I created in excel through VB. I want to try and change the font name from Times New Roman to Symbol. I tried recording the macro in excel but when I use the code in VB...
9
by: AGP | last post by:
I have a VB6 application that has an OLE container with an embedded Excel chart. Our office updated to Excel 2007 and now although the app works the charts looks like crap. Since the app is fairly...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.