Results 1 to 3 of 3

Thread: Close workbook without warning popup if the flie is read only

  1. #1
    Junior Member
    Join Date
    Jul 2011
    Posts
    19
    Rep Power
    0

    Close workbook without warning popup if the flie is read only

    I have a macro that automatically closes out of all open workbooks linked to pickup the data.
    however, I want it to close without saving the read only documents. Right now it closes out of everything, but a pop up appears asking if the user wants to save the read only worksheet.

    I don't want that pop-up to appear. I want it to just exit out and save all spreadsheets except the read only ones WITHOUT asking.

    The macro also asking for link updation message. can this also avoid while running the Macro?

    Here is the current code is pasted below.

    Code:
    Sub Update()
    '
    ' Update Macro
    '
    ' Keyboard Shortcut: Ctrl+u
    '
        Range("D8").Select
        Selection.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True
        ActiveWindow.Close
        Range("D9").Select
        Selection.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True
        ActiveWindow.Close
        Range("D10").Select
        Selection.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True
        ActiveWindow.Close
        Range("D11").Select
        Selection.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True
        ActiveWindow.Close
        Range("D12").Select
        Selection.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True
        ActiveWindow.Close
      End Sub

  2. #2
    Administrator Admin's Avatar
    Join Date
    Mar 2011
    Posts
    1,123
    Rep Power
    10
    Hi Leo,

    Replace
    Code:
    ActiveWindow.Close
    with

    Code:
    ActiveWindow.Close 0
    Cheers !

    Excel Range to BBCode Table
    Use Social Networking Tools If You Like the Answers !

    Message to Cross Posters

    @ Home - Office 2010/2013/2016 on Win 10 (64 bit); @ Work - Office 2016 on Win 10 (64 bit)

  3. #3
    Junior Member
    Join Date
    Jul 2011
    Posts
    19
    Rep Power
    0
    Thankyou verymuch... Great

    Exactly what I need

Similar Threads

  1. Macro To Close All CSV Files
    By Howardc in forum Excel Help
    Replies: 5
    Last Post: 03-15-2014, 05:24 PM
  2. Warning Alerts Depending On Time Remaining To Finish Task
    By peter renton in forum Excel Help
    Replies: 9
    Last Post: 06-19-2013, 12:20 PM
  3. Read/write very large xl2007 files
    By Rasm in forum Excel Help
    Replies: 3
    Last Post: 04-07-2012, 05:28 AM
  4. Timer to close excel workbook
    By leopaulc in forum Excel Help
    Replies: 5
    Last Post: 10-24-2011, 12:31 PM
  5. Replies: 9
    Last Post: 09-09-2011, 02:30 AM

Posting Permissions

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