+ Reply to Thread
Results 1 to 8 of 8

Msgbox is lethargic / slow!

  1. #1
    Registered User
    Join Date
    12-12-2018
    Location
    Virginia
    MS-Off Ver
    Windows x
    Posts
    5

    Msgbox is lethargic / slow!

    My msgbox and inputBox sometimes... SOMETIMES... gets really slow. There can be as much as a 5 or 6 second lag between key inputs. This problem is intermittent.

    I'm pretty advanced in my knowledge of VBA / Excel. I'm far from a beginner by any stretch of the imagination. I'm hoping someone reads this and know more about Excel's programming.

    What I've tried so far: When my VBA program runs, I start off with the typical 3 (screen updating off, calculation to manual, enable events off). I also have a debug log setup within my program to record where code the program is and at what time. These checkpoints are all over my code. That sub looks like this:

    Please Login or Register  to view this content.

    My other sub looks something like this

    Please Login or Register  to view this content.
    and my checkpoint text file records location x and y along with the long lag, but nothing in between.
    Last edited by jayplac; 01-12-2019 at 12:42 PM.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    18,764

    Re: Msgbox is lethargic / slow!

    Eh, what's the question/problem?

    PS When posting code can you please use CODE tags?
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    12-12-2018
    Location
    Virginia
    MS-Off Ver
    Windows x
    Posts
    5

    Re: Msgbox is lethargic / slow!

    I'll edit my post momentarily with tags. My question is 'Why do I have such a lag between character entries (inputbox) or tabbing between yes and No (msgbox), or clicking ok and waiting for something to happen.

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    18,764

    Re: Msgbox is lethargic / slow!

    Can you post the code where this apparent 'lag' is occurring?

    PS Perhaps the problem is with your DebugCheckPoint sub which is writing to a file, which I would think might slow things down a bit.

  5. #5
    Registered User
    Join Date
    12-12-2018
    Location
    Virginia
    MS-Off Ver
    Windows x
    Posts
    5

    Re: Msgbox is lethargic / slow!

    It's a very long and arduous code which calls on many other subs. Are you looking for something specific?

    The debug checkpoint is extremely fast. Please take a minute and try it. However, next time my computer slows down, I will circumvent the checkpoint and see what happens.

    Update: The program is acting up at the moment and I placed 'EXIT SUB' in the second line of the debugCheckpoint with no avail. The problem still exists.
    Last edited by jayplac; 01-12-2019 at 01:57 PM.

  6. #6
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    2016 Win10
    Posts
    6,874

    Re: Msgbox is lethargic / slow!

    Do you get the same problem with input boxes in a new workbook without all your code?

  7. #7
    Registered User
    Join Date
    12-12-2018
    Location
    Virginia
    MS-Off Ver
    Windows x
    Posts
    5

    Re: Msgbox is lethargic / slow!

    Not sure. I'll test it the next time it happens.

  8. #8
    Registered User
    Join Date
    12-12-2018
    Location
    Virginia
    MS-Off Ver
    Windows x
    Posts
    5

    Re: Msgbox is lethargic / slow!

    On the suggestion of Kyle123, I tested the msgbox on a new sheet while experiencing the problem. It works fine. Though that got me thinking that one of the parameters, which gets set to false/manual at the beginning of the sub was messing with me. The problem is seemingly fixed by turning application.screenupdating back to true while dealing with the message box.

    Though it wasn't your suggestion, it led to the solution; thanks Kyle.

+ 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