Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Charting / November 2006

Tip: Looking for answers? Try searching our database.

XValues - Why is code1 OK - but code2 doesn't work?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
tskogstrom - 25 Oct 2006 06:13 GMT
Hi, I have a xlColumnClustered chart of three bars only, with values
and names picked from cells not besie eachother. The first working code
is based on recording, but I can't have RC reference in my code.

The second code, I get "Unable to set the XValues property of the
Series class" 1004 runtime error.

Why doesn't the second work?

'cht.SeriesCollection(1).XValues = _
'    "=(Report!R6C7,Report!R6C4,Report!R3C17)"

cht.SeriesCollection(1).XValues = Union(Sheet2.Range("nme1"),
Sheet2.Range("nme2"), _ Sheet2.Range("nme3"))
   
Kind regards
tskogstrom
Andy Pope - 25 Oct 2006 09:01 GMT
Hi,

An educated guess would be that the assignment can not deal with
multiple areas.

Try this instead, where each element is fully described.

cht.SeriesCollection(1).XValues = "=('" & _
Sheet2.Name & "'!" & _
Sheet2.Range("nme1").Address(True, True, xlR1C1) & _
",'" & Sheet2.Name & "'!" & _
Sheet2.Range("nme2").Address(True, True, xlR1C1) & _
",'" & Sheet2.Name & "'!" & _
Sheet2.Range("nme3").Address(True, True, xlR1C1) & ")"

Cheers
Andy

> Hi, I have a xlColumnClustered chart of three bars only, with values
> and names picked from cells not besie eachother. The first working code
[quoted text clipped - 13 lines]
> Kind regards
> tskogstrom

Signature

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info

tskogstrom - 25 Oct 2006 12:46 GMT
Thank you, your guess was correct - it work ok now.

Thanks again,
tskogstrom

Andy Pope skrev:

> Hi,
>
[quoted text clipped - 31 lines]
> > Kind regards
> > tskogstrom
tskogstrom - 23 Nov 2006 18:44 GMT
I recently got a similar error, but the problem was that the reference
area of the chart was hidden rows and columns.

Seems like charts demand visible cells...hope this help someone more
...This might have been the reason to this tread question also.

/Regards
tskogstrom
-------------------------------

tskogstrom skrev:

> Thank you, your guess was correct - it work ok now.
>
[quoted text clipped - 43 lines]
> > Andy Pope, Microsoft MVP - Excel
> > http://www.andypope.info
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.