Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Coding charts in Excel 2000 VBA ("Whoa, why are you a PivotChart ?")

Status
Not open for further replies.

fuzzword

Programmer
Jul 24, 2001
8
US
I'm having a problem in which a report created in Excel 97, which creates a chart using VBA code and uses data from a pivot table for its source. The chart looks great in 97.

The thing is, when it's opened in Excel 2000 (which only a few of our users have), the Chart turns into a PivotChart, and automatically selects TOO MUCH data for its source (it seems to select ALL of the Pivot Table data instead of just the data specified.

here is the line that selcts the data source:

chtGraph.SetSourceData Source:=Sheets _
("Pivot Table").Range( _
"A16,A18:A22,V16:X16,V18:X22"), _
PlotBy:=xlColumns

Instead, it seems to select the entire pivot table as source data, and makes the chart a pivot chart. I

Any ideas on how to coreect this - we don't want this to be a pivot chart, but Excel 2000 seems to do this automatically.

Can the type somehow be changed from being a PivotChart? If not, can the range be forced to selected as indicated above, instead of it selecting the entire PivotReport range?

I'm at a loss. I need a beer.

Thanks!

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top