the pasted code works for the first two pie charts but it gets caught on the third
on this line ActiveChart.SeriesCollection(1).Values = datarange2
any advice?
![]()
Please Login or Register to view this content.
the pasted code works for the first two pie charts but it gets caught on the third
on this line ActiveChart.SeriesCollection(1).Values = datarange2
any advice?
![]()
Please Login or Register to view this content.
Hello;
so, "gets caught" can mean a bunch of things....do you get an error?...does the macro actually hang and you have to close XL?....
Ernest
Please consider adding a * if I helped
Nothing drives me crazy - I'm always close enough to walk....
Hi Judgeh,
Runtime error: Invalid Parameter
A blank chart is created with no data.
I appreciate the help.
my guess would be that either variable "d" or "f" are not valid for the range...without see the data I'm just guessing...
what do you mean by "not valid for the range"?
When I run line by line d is 63 and f is 8
sorry, just wondering if the range(Cells(63,18),Cell(63,25)) is a valid range for the chart....can you upload a file with no company confidential info?...
Thanks for looking into this!
Last edited by ajm1991; 11-04-2014 at 03:08 PM.
this seems to work...
I added a line that chose a field in your dataset. I looked like the first 2 passes it was pick up data when you created the chart and then "changed" the dataset. BUT, the 3rd time it didn't seem to have a dataset, so I told XL to chose the dataset where the current cell was and that seem to work....it's definitely not my preferred method....
hope this helps....
![]()
Please Login or Register to view this content.
hmmm weird. how did you figure out that was the issue?
I stepped through the code (F8) and watch how everything was being created....I noticed that the 1st 2 times after the Chart.add the chart was created using data but the 3rd time, no data....so, knowing that XL will attempt to create a chart with a dataset using a single cell and contiguous data, I forced it....
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks