+ Reply to Thread
Results 1 to 6 of 6

Empty message/warning box during the running of a Macro

  1. #1
    Registered User
    Join Date
    06-13-2013
    Location
    netherlands
    MS-Off Ver
    Excel 2003
    Posts
    2

    Empty message/warning box during the running of a Macro

    Hello,

    During the running of several macro's I get empty message/warning boxes. There doesn't seems to be a pattern in the moments they appear (although I get the feeling it appears more when I use the same macro's while not closing the file in between).

    msgbox.png

    When the box appears, the macro holds, but it seems to me that the macro's still do what they should do, also after clicking away the box (either by clicking on the cross, or clicking OK). Does anyone now why this warning appears and what the effect of it may be?

    Thanks in advance!

    Kevin

  2. #2
    Forum Contributor
    Join Date
    08-02-2012
    Location
    Pune
    MS-Off Ver
    Office 365 (Win 10)
    Posts
    489

    Re: Empty message/warning box during the running of a Macro

    Add this before your macro
    PHP Code: 
    Sub YourSub()




    Answer MsgBox("Are you sure you want to continue?" vbNewLine "Clicking 'YES' will continue" vbNewLine "Another optional line"vbYesNoCancel vbInformation"Warning: Your message")

    If 
    Answer vbYes Then Else Exit Sub 

  3. #3
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,767

    Re: Empty message/warning box during the running of a Macro

    If possible please share the code with us


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  4. #4
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Empty message/warning box during the running of a Macro

    You can supress the message by including a line in your code.
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    06-13-2013
    Location
    netherlands
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Empty message/warning box during the running of a Macro

    Thank you all for the quick replies.

    As the solution of AB33 seems the quickest and simplest way, I've chosen to try that one.

    The times I tested it, it worked fine! So thank you!

    Does anyone know the reason why these empty boxes appear? Has anyone ever encounter these before?

  6. #6
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Empty message/warning box during the running of a Macro

    Kevin,
    There could be many reasons but since this happens when you run a code, the code may have a line which does this, or you are calling another code which is triggered a message box.
    You need to step over your code, not just run it, run it by pressing F8. As you step over each line, you should be able to see what each line does. If the code is linked to another code, the code will jump in to that code. Hopefully, the message will pop up once you have reached that line.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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