Consulting

Results 1 to 12 of 12

Thread: Retaining the Macro code for disabling Save option in Excel

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    VBAX Newbie
    Joined
    Jan 2016
    Posts
    4
    Location

    Retaining the Macro code for disabling Save option in Excel

    Hi,
    I can disable the save option using below code in ThisWorkbook.
    After I close the current excel sheet, the Macro code disappears when I open new excel sheet.
    I tried applying breakpoint, but this is not user friendly.
    Please get back soon for above query.

    Option Explicit
    
    Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
        Cancel = True
    End Sub
    Last edited by Aussiebear; 06-18-2025 at 03:32 PM.

Posting Permissions

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