Consulting

Results 1 to 6 of 6

Thread: Charts and forms freeze after VBA macro execution

  1. #1
    VBAX Newbie
    Joined
    Jun 2019
    Posts
    3
    Location

    Charts and forms freeze after VBA macro execution

    Hello,


    I have an issue with an Excel VBA tool (find a simplified version enclosed) I created.
    When I run my code Plot_Chart (update charts form) all charts and forms freeze or disappear.
    I understand it as a display bug because after the save and restart everything works again!

    I am using Microsoft Office Standard 2016
    It seems to be happening only from a few month, this code has been working without issue for a while before

    I tried:
    -Disable hardware acceleration
    -Disconnect other displays
    -Other computers with windows 7/10

    Nothing worked... Any idea?
    Attached Files Attached Files
    Last edited by Vatlin; 06-12-2019 at 01:12 AM.

  2. #2
    Moderator VBAX Guru Aussiebear's Avatar
    Joined
    Dec 2005
    Location
    Queensland
    Posts
    4,997
    Location
    Have you for instance used Option Explicit at the start of your code, or stepped through your code to test each line?
    Remember To Do the Following....
    Use [Code].... [/Code] tags when posting code to the thread.
    Mark your thread as Solved if satisfied by using the Thread Tools options.
    If posting the same issue to another forum please show the link

  3. #3
    Knowledge Base Approver VBAX Wizard p45cal's Avatar
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    5,844
    After running Plot_Chart several times the chart disappeared. It was there though.
    No idea what's going on, however:
    1. Disabling all Application.Screenupdating = False lines caused the problem to go away.
    2. I added a New Window via the Window section of the View tab of the ribbon which created a new window with the chart visible!
    p45cal
    Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.

  4. #4
    VBAX Newbie
    Joined
    Jun 2019
    Posts
    3
    Location
    I just solved the issue by removing Worksheet_Ref.ChartObjects(1).Select before deleting the selected chart.
    It seems that Excel doesn't like it ! Always follow the most important rule:
    Don't use .Select methods
    Thank you for your help, you can close the topic

  5. #5
    Knowledge Base Approver VBAX Wizard p45cal's Avatar
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    5,844
    Quote Originally Posted by Vatlin View Post
    I just solved the issue by removing Worksheet_Ref.ChartObjects(1).Select before deleting the selected chart.
    Excellent! I would never have thought that would solve it. What pointed you in that direction?
    p45cal
    Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.

  6. #6
    VBAX Newbie
    Joined
    Jun 2019
    Posts
    3
    Location
    It was a difference with an older version of the tool without this bug.
    I am still trying to find a solution to the Worksheet_Ref.ChartObjects(1).Copy command which randomly bug if I copied something before running the code

Posting Permissions

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