LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 262
Default I think the problem is in .SetSourceData ??

Hello,
I am using VBA to create scatterplot charts. There are two series on each
chart. The VBA is working well, now, except that sometimes, in an
unpredictable way, the program is plotting a third series, where the X, Y
values are only 1, and 1. On the scatterplot they appear as a single dot in
the 1,1, position. At other times, the 1,1 point is plotted on a new chart
that is never defined in my code. When this happens, the chart is most
often, a single vertical bar at the location where the X value is 1.

As near as I can tell, this may have to do with the fact that my VBA does
not use the following statement (or something like it) to specify the source
data:

Charts(1).SetSourceData Source:=Sheets(1).Range("a1:a10"), _
PlotBy:=xlColumns

The statement is not used because my source data ranges are set by code,
later in the subroutine. When I record a macro, so I can look at the VBA
that is generated, the .SetSourceData method corresponds to the second Chart
Wizard dialogue box that asks a user to specify a data range, and whether the
data range is in columns or rows. However, when specifying a scatterplot
using the wizard, the data range in the second chart wizard dialog is
irrelevant. Instead, one should define the two series in €śseries€ť Tab, not
the €śData Range€ť tab.

So, if my assumption is true, and its the .SetSourceData method that is
causing the problem, what would be a way to fix it? Using the research
tools, and by recording a macro, all I see as parameters for the
..SetSourceData method are €śSource:€ť and €śPlotBy:€ť

So far, nothing Ive tried has passed the VBA error checker.

Does anyone have any thoughts on this?

Keith






 
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
defined names and setsourcedata Jason Morin Charts and Charting in Excel 2 December 5th 07 03:39 PM
setSourcedata tony wong Excel Programming 2 February 22nd 07 02:06 PM
charting problem with activechart.setsourcedata Mary Kathryn Excel Discussion (Misc queries) 4 February 25th 06 08:54 PM
SetSourceData for Chart Doerte Excel Programming 2 November 29th 04 11:55 AM


All times are GMT +1. The time now is 04:49 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"