PDA

Click to See Complete Forum and Search --> : Excel and VB: setting range for graphs


karsten
Jul 6th, 2001, 08:21 AM
Hi all,

I am trying to alter the source range for an excel graph from my VB programm. This works fine when I run the macro in Excel. However, when I try to do the same from VB it does not work.
Anybody an idea ?

Thanks
Karsten
_________________________________________
Dim wb As Workbook

With wb
.Sheets("Diagramm1").Activate
.Sheets("Diagramm1").Select
.ActiveChart.PlotArea.Select
.ActiveChart.SetSourceData Source:=Sheets("Tabelle1").Range(.Cells(1, 1), .Cells(5, 2)), PlotBy _
:=xlColumns
end with

karsten
Jul 12th, 2001, 12:11 PM
Hi all,

really - nobody an idea. I' am absolutely desperate !
- still got no solution to the problem. Excel does just not modify the range.

Even

Charts("Diagramm1").SeriesCollection.Add Source:=Worksheets("Tabelle1").Range("A1:B10")

does not work and Excel exits the subroutine wirthout any notice !
(I am ausing VB 6 and excel 2000)

A desperate
Karsten