+ Reply to Thread
Results 1 to 8 of 8

auto close msgbox

  1. #1
    Forum Contributor
    Join Date
    09-30-2010
    Location
    Minnesota, USA
    MS-Off Ver
    Excel 2010
    Posts
    109

    auto close msgbox

    I am opening a file with a macro and the file I am opening has a msgbox that opens right a way. I would like to close it so that my macro process can continue.
    Can this be done?

    Please Login or Register  to view this content.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: auto close msgbox

    You can disable events before you open the file to prevent the workbook_open event from triggering.

    Don't forget to turn them back on.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Contributor
    Join Date
    09-30-2010
    Location
    Minnesota, USA
    MS-Off Ver
    Excel 2010
    Posts
    109

    Re: auto close msgbox

    I have tried something like that, but it did not work
    Code I used was
    Application.DisplayAlerts = False
    Application.DisplayAlerts = True
    Is this the same thing?

  4. #4
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983

    Re: auto close msgbox

    What is the source of the message box and what inormation is it displaying.

    i.e is it a macro generated or an Excel standard message like when you open a password protected or read only file
    Please Read Forum Rules Before Posting
    Wrap VBA code by selecting the code and clicking the # icon or Read This
    How To Cross Post politely

    Top Excel links for beginners to Experts

    If you are pleased with a member's answer then use the Scales icon to rate it
    If my reply has assisted or failed to assist you I welcome your Feedback.

  5. #5
    Forum Contributor
    Join Date
    09-30-2010
    Location
    Minnesota, USA
    MS-Off Ver
    Excel 2010
    Posts
    109

    Re: auto close msgbox

    the message box was made with a form and is displayed instinly when you open the file and it states the General Information about this file for those who refference it's data. like my selef.

    This is the code that displays the message, but I can't change any thing in that file.
    and This code is located in the folder “Microsoft excel object” and named “ThisWorkbook”
    Please Login or Register  to view this content.

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: auto close msgbox

    Quote Originally Posted by CityMPLSEmpolyee
    Code I used was
    Application.DisplayAlerts = False
    Application.DisplayAlerts = True
    Is this the same thing?
    No.
    Please Login or Register  to view this content.

  7. #7
    Valued Forum Contributor jwright650's Avatar
    Join Date
    12-10-2010
    Location
    Va, USA
    MS-Off Ver
    Excel 2003, Excel 2010
    Posts
    606

    Re: auto close msgbox

    If the msgbox/userform is a necessary item, can you use a timer to display the msgbox/userform for say 5 seconds and then unload it and move on?
    Life is like a roll of toilet paper. The closer it gets to the end, the faster it goes.
    John Wright

  8. #8
    Forum Contributor
    Join Date
    09-30-2010
    Location
    Minnesota, USA
    MS-Off Ver
    Excel 2010
    Posts
    109

    Re: auto close msgbox

    first to Shg thank you your code worked,
    and to answer jwright650
    I don't have right permisstion to the file that I am reffernceing so I can't edit that code

    Solved
    Last edited by CityMPLSEmpolyee; 03-04-2011 at 11:54 AM. Reason: to note Solved

+ 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