Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,582
Default Dynamic Chart Building - "Unable to set the ... property of the Se

What do these strings look like? Are they valid for this use?
strPrefix & SeriesStartRow & "C" & SeriesColumn
strPrefix & SeriesStartRow & "C" & XValueColumn & ":R" & SeriesEndRow & "C"
& XValueColumn
strPrefix & SeriesStartRow & "C" & DataColumn & ":R" & SeriesEndRow & "C" &
DataColumn

What kind of chart is it? What is the initial source data? Valid numbers and
labels, or blanks, or what?

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"Dale Fye" wrote in message
...
I have a function that loops through a dataset and dynamically builds the
chart series for a bunch of charts. 95% of the time, this function works
properly, but occassionally, I get an error that reads "Unable to set the
.... property of the Series class", where the ... represents Name,
XValues,
and Values.

Some of the sheet names contain spaces, so I encapsulated them in single
quotes, which seems to work most of the time.

The code that is generating the problem looks like:

strPrefix = "='" & ActiveSheet.name & "'!R"
ActiveChart.SeriesCollection(SeriesCount).Name = strPrefix &
SeriesStartRow
& "C" & SeriesColumn

ActiveChart.SeriesCollection(SeriesCount).XValues = strPrefix &
SeriesStartRow & "C" & XValueColumn & ":R" & SeriesEndRow & "C" &
XValueColumn

ActiveChart.SeriesCollection(SeriesCount).Values = strPrefix &
SeriesStartRow & "C" & DataColumn & ":R" & SeriesEndRow & "C" & DataColumn


--
Email address is not valid.
Please reply to newsgroup only.



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,582
Default Dynamic Chart Building - "Unable to set the ... property of th

I think the error may have to do with an invalid reference
in the first data series on a chart.


This is what I was thinking. If you may get this kind of problem, you could
temporarily change the chart type to area or column (which are more tolerant
of bad data than XY or line types), but this may disturb your axis layout.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"Dale Fye" wrote in message
...
Jon

Love your site. Have been using it a lot lately to get charting ideas.

This particular function is formatting stacked bar charts.

An example of these property values is :

...Name = "='AC_losses_pct'!R617C4"
..XValues = "='AC_losses_pct'!R617C6:R633C6"
..Values = "='AC_losses_pct'!R617C7:R633C7"

The way my code is written, after selecting a chart, it deletes all of the
data series except the first one (1). I'm keeping that one , because it
appears that the other chart properties (X and Y axis formatting) get lost
if
I delete all of the data series.

After posting this message, I went back into the worksheet, and reset each
of the charts so that their first data series was working properly, and
deleted all of the other series from each chart. When I re-ran the
function,
It worked fine. I think the error may have to do with an invalid
reference
in the first data series on a chart.

Thanks, would appreciate any of your insights.


--
Email address is not valid.
Please reply to newsgroup only.


"Jon Peltier" wrote:

What do these strings look like? Are they valid for this use?
strPrefix & SeriesStartRow & "C" & SeriesColumn
strPrefix & SeriesStartRow & "C" & XValueColumn & ":R" & SeriesEndRow &
"C"
& XValueColumn
strPrefix & SeriesStartRow & "C" & DataColumn & ":R" & SeriesEndRow & "C"
&
DataColumn

What kind of chart is it? What is the initial source data? Valid numbers
and
labels, or blanks, or what?

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"Dale Fye" wrote in message
...
I have a function that loops through a dataset and dynamically builds
the
chart series for a bunch of charts. 95% of the time, this function
works
properly, but occassionally, I get an error that reads "Unable to set
the
.... property of the Series class", where the ... represents Name,
XValues,
and Values.

Some of the sheet names contain spaces, so I encapsulated them in
single
quotes, which seems to work most of the time.

The code that is generating the problem looks like:

strPrefix = "='" & ActiveSheet.name & "'!R"
ActiveChart.SeriesCollection(SeriesCount).Name = strPrefix &
SeriesStartRow
& "C" & SeriesColumn

ActiveChart.SeriesCollection(SeriesCount).XValues = strPrefix &
SeriesStartRow & "C" & XValueColumn & ":R" & SeriesEndRow & "C" &
XValueColumn

ActiveChart.SeriesCollection(SeriesCount).Values = strPrefix &
SeriesStartRow & "C" & DataColumn & ":R" & SeriesEndRow & "C" &
DataColumn


--
Email address is not valid.
Please reply to newsgroup only.






Reply
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
"Unable to get the VLookup property of the WorksheetFunction class Ayo Excel Discussion (Misc queries) 4 August 6th 08 10:00 PM
Interop - "Unable to set the Color property of the Interior class" Elsa Excel Programming 2 August 23rd 06 04:57 AM
"Unable to set the Formula property of the Series class" with a tw PeterQ Charts and Charting in Excel 1 February 15th 06 07:37 PM
"Unable to get the Pivotfieldsd property of the Pivot Class" twaccess[_21_] Excel Programming 1 July 8th 05 01:42 PM
Pivot table....building arguments for the .RowField property sclark Excel Programming 0 January 21st 04 05:31 PM


All times are GMT +1. The time now is 07:57 AM.

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

About Us

"It's about Microsoft Excel"