+ Reply to Thread
Results 1 to 7 of 7

Suppress Excel system message

  1. #1
    Forum Contributor
    Join Date
    01-18-2012
    Location
    nr Salisbury, UK
    MS-Off Ver
    Excel 2010
    Posts
    126

    Suppress Excel system message

    When attempting to open a Workbook using msoFileDialogFilePicker I get a Microsoft Excel Message:- “Book is already open. Reopening will cause changes you made to be discarded – Do you want to continue” Yes/No
    If choose “Yes” – that’s fine.
    But if I selected the “No” option it would through a ‘Runtime Error 1004 – Method Open of Object “Workbook” failed’ message at the line highlighted due to the Workbook I am attempting to open being already open but UNSAVED.
    I have inserted a Error Handler to deal with the issue of selecting the “No” option.

    But of course I am still getting the Microsoft Excel Message:- “Book is already open. Reopening will cause changes you made to be discarded – Do you want to continue” Yes/No; is there any way I can suppress this message or deal with the Runtime Error 1004 in a different way.

    Please Login or Register  to view this content.

  2. #2
    Valued Forum Contributor
    Join Date
    05-14-2012
    Location
    Unknown
    MS-Off Ver
    Unseen
    Posts
    429

    Re: Suppress Excel system message

    You could perhaps use Application.DisplayAlerts = False. However, that takes a default value and I'm not sure what the default is in this situation.

  3. #3
    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: Suppress Excel system message

    Another way:

    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

  4. #4
    Forum Contributor
    Join Date
    01-18-2012
    Location
    nr Salisbury, UK
    MS-Off Ver
    Excel 2010
    Posts
    126

    Re: Suppress Excel system message

    Thanks shg.

    Get the MsgBox as intended if Workbook is open; but getting a Runtime Error 91 – Object variable or With block variable not set - on line (29) If LCase(wkb.FullName) <> LCase(sFile) Then Set wkb = Workbooks.Open(sFile) if it’s not open.

  5. #5
    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: Suppress Excel system message

    Ah. Try

    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    01-18-2012
    Location
    nr Salisbury, UK
    MS-Off Ver
    Excel 2010
    Posts
    126

    Re: Suppress Excel system message

    That's it, many thanks shg

  7. #7
    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: Suppress Excel system message

    You're welcome.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 2
    Last Post: 11-14-2012, 10:04 AM
  2. Excel 2007 VBA...suppress "opening" message when refreshing pivot data
    By dbiggied in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 06-22-2012, 10:44 AM
  3. Suppress Circular reference message
    By kevie192 in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 02-20-2009, 05:32 AM
  4. Suppress Update Links Message
    By blatham in forum Excel General
    Replies: 2
    Last Post: 04-20-2006, 09:40 AM
  5. [SOLVED] How to suppress Excel default message
    By Sandy in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-20-2005, 11:00 PM
  6. Replies: 4
    Last Post: 12-06-2005, 04:40 AM
  7. suppress Excel save message
    By Ben in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-29-2005, 11:05 AM
  8. Need To Suppress Message Alert
    By davidm in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-19-2005, 03:12 PM

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