beforeclose event

  1. J

    Code in BeforeClose is executing but having no effect

    I have the following code in an Excel 2010 workbook: Private Sub Workbook_BeforeClose(Cancel As Boolean) Application.EnableEvents = True Dim FileName As String FileName = ActiveWorkbook.Name If FileName = "False" Then Exit Sub If FileName <> "Shipping Manifest...
  2. L

    Check whether the current user has been removed (kicked) from the shared workbook?

    I have a shared document which runs various commands upon close. This includes saving normally (if document is still shared) and saving as shared (if document was unshared). The problem arises when a person left the document open for a while then close it. The document automatically overrides...
  3. A

    Closing secondary files

    I am looking for a line of VBA code to use after I execute code to go into a secondary file to make an update and then “save (as new file) and close” the secondary file without having to get the exit message that asks me if I want to save the file. I am currently using the following lines in a...
  4. R

    Workbook_BeforeClose (Cancel As Boolean)

    Hi, I have read all there is in here on the Workbook_BeforeClose and I cant get it to work. The jist is to protect all sheets and the workbook whenever a user closes the workbook. Current code is (which is under ThisWorkbook). Any help would be excellent and thanks in advance. Private Sub...
  5. rudfaden

    SaveCopyAs runtime error

    When i use the following code in Excel 2011 for Mac i get runtime Error 1004. Does anyone have an idea to fix it? Private Sub Workbook_BeforeClose(Cancel As Boolean) Dim Msg As String Dim Ans As Integer Dim FName As String Msg = “Would you like to make a backup of this file?” Ans =...
  6. ClimoC

    BeforeClose problem - Cancel close

    I'm not even entirely sure my code will work, but right now I'm getting stuck on something else "Compile Error: Procedure declaration does not match descfription of event or procedure having the same name" Is the error I get when this fires: Private Sub Project_BeforeClose(Cancel As...
  7. C

    Workbook_BeforeClose event

    When I open an excel file the workbook open event runs code to disable cut, copy and paste and hides the formula bar. When the file is closed I wish to enable cut, copy and paste and show the formula bar. I have tried the following code but it doesn't work. Does anyone know how to write code...

Some videos you may like

This Week's Hot Topics

Top