Results 1 to 4 of 4

Thread: Error when trying to access data for RegionMap chart type

  1. #1
    VBAX Newbie
    Joined
    Oct 2023
    Posts
    3
    Location

    Error when trying to access data for RegionMap chart type

    Excel macro that loops through slides of a PowerPoint presentation and changes the data for numerous charts.


    Macro works perfectly fine until it comes across a shape where .Chart.ChartType=xlRegionMap


    Code where I get the error:
    Set wbk = Sh.Chart.ChartData.Workbook

    Again, this line works fine for every other type of chart except a region map. Anyone know why this is, and have a workaround?


    Any help is much appreciated!

  2. #2
    MS Excel MVP VBAX Mentor Andy Pope's Avatar
    Joined
    May 2004
    Location
    Essex, England
    Posts
    344
    Location
    Have you tried activating the chartdata first?

    Sh.Chart.ChartData.activate
    Set wbk = Sh.Chart.ChartData.Workbook
    Cheers
    Andy

  3. #3
    Quote Originally Posted by Andy Pope View Post
    Have you tried activating the chartdata first?
    Sh.Chart.ChartData.activate
    Set wbk = Sh.Chart.ChartData.Workbook

    Can you explain this part specifically?

  4. #4
    MS Excel MVP VBAX Mentor Andy Pope's Avatar
    Joined
    May 2004
    Location
    Essex, England
    Posts
    344
    Location
    On a standard chart this would activate the data sheet, where the values are stored
    Cheers
    Andy

Posting Permissions

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