Results 1 to 2 of 2

Thread: Excel and VB: setting range for graphs

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2001
    Location
    Sindelfingen, Germany
    Posts
    9

    Question Excel and VB: setting range for graphs

    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
    KV

  2. #2

    Thread Starter
    New Member
    Join Date
    Apr 2001
    Location
    Sindelfingen, Germany
    Posts
    9

    Unhappy

    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
    KV

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width