Results 1 to 2 of 2
  1. #1
    5 Star Lounger
    Join Date
    Apr 2003
    Location
    Hampshire, United Kingdom
    Posts
    602
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Setsourcedata - type mismatch (2003)

    The following line of code is returning a type mismatch error, and I'm not sure why! shtModel and shtWorking are both worksheets, by the way...

    shtModel.ChartObjects(1).Chart.SetSourceData (shtWorking.Range("I2:AA11"))

    What's wrong?
    Waggers
    If at first you do succeed, you've probably missed something.

  2. #2
    5 Star Lounger
    Join Date
    Apr 2003
    Location
    Hampshire, United Kingdom
    Posts
    602
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Solved

    Well, I've found a solution - instead of using the VBA name for the sheet (shtWorking), using its display name does the trick:

    shtModel.ChartObjects(1).Chart.SetSourceData (Sheets("Working").Range("I2:AA11"))

    I don't know why it should make a difference, though. <img src=/S/shrug.gif border=0 alt=shrug width=39 height=15>
    Waggers
    If at first you do succeed, you&#39;ve probably missed something.

Posting Permissions

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