+ Reply to Thread
Results 1 to 2 of 2

Macro works when stepped through but not when run (Excel03)

  1. #1
    Registered User
    Join Date
    06-28-2011
    Location
    Bristol, UK
    MS-Off Ver
    Excel 2010, 2013, 2016, 365
    Posts
    79

    Exclamation Macro works when stepped through but not when run (Excel03)

    Hi All,

    I have seen a few similar queries out there but none of them seem to solve my problem:

    I have a dashboard which contains a series of charts. I have written some code which is triggered by clicking on a chart and which then causes that chart to increase in size -- i.e. zooming in on it. Clicking the enlarged chart then reduces it back down to its original size. This works like a charm in Excel07 but I am attempting to make this work across both 03 and 07 and, in the former, the chart increases in size correctly (although the textboxes & legend positions are wrong) but on clicking a second time the dimensions of plot area reduce by 4 rather than 2 -- i.e. it ends up half the size it should be.

    When I step through the code, however, I cannot replicate this and it works perfectly as it should.

    I have identified the following sub as the culprit (the size of the chart object itself is controlled elsewhere, at which point the gobal variable 'Large' is set to True if the chart has just been increased in size, otherwise False)
    Please Login or Register  to view this content.
    I have stripped away everything unnecessary to complete this single action and I still cannot see why it will only work when stepping through the code. I tried to put a 1sec wait in prior to the PlotArea resize but that didn't seem to make any difference.

    Does anyone have any suggestions as to why this is happening and how to resolve it? It's pretty urgent

    Many thanks,
    AdLoki

  2. #2
    Registered User
    Join Date
    06-28-2011
    Location
    Bristol, UK
    MS-Off Ver
    Excel 2010, 2013, 2016, 365
    Posts
    79

    Re: Macro works when stepped through but not when run (Excel03)

    I haven't solved this problem yet but in case anyone has a similar issue, I think it relates to Excel 03's AutoScaling of plot areas, which (as far as I can tell) cannot be overwritten or edited.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1