workbook_beforeclose

  1. M

    AutoSave on exit stopped working

    My PERSONAL.xlsb has been set up for years to save before exit without the prompt to save. Now it has stopped working. It does not matter if the worksheet is opened individually or after taking the focus after closing another sheet. In VBAProject>>ExcelObject>ThisWorkbook Private Sub...
  2. J

    Can't close book programmatically inside of Workbook_BeforeClose if triggered programmatically

    i'd like to intercept BeforeClose with my own process, and cancel the default process. Not working as expected: Create a new workbook, enter the following, and save: ThisWorkbook module: Private Sub Workbook_BeforeClose(Cancel As Boolean) Cancel = True...
  3. P

    How to call Workbook_BeforeClose Event when commandbutton is pressed

    Option Explicit Private Sub CommandButton1_Click() Workbook_BeforeClose End Sub Private Sub UserForm_Initialize() Me.Caption = "Print, Save and Close" With Me.Label1 .Caption = "Do you want to print, save and close the workbook named: " & """" & ActiveWorkbook.Name & """"...
  4. J

    Workbook_BeforeClose not working when closing application

    In Excel 2010, if I use the close workbook "X", Workbook_BeforeClose works, but if I use the application close button, it does not - why?
  5. S

    The Workbook_BeforeClose event in not working

    I created the popup calendar from Martin Green's site, saved it in a personal project like it said, and I keep getting the "Insert Date" adding to the context menuwhen you right click in a cell tofirethe popup calendar. The only thing that I can imagine is that the Workbook_BeforeClose code is...
  6. R

    Help with Workbook_BeforeClose

    Hello, I would assume this would be a simple enough question that I wouldn't have to start a new thread. However, I have searched far and wide for an answer and have come up with nothing. So I am trying to figure out the proper function of the "Workbook_BeforeClose" event. My understanding is...
  7. PritishS

    ThisWorkbook.Save or Me.Password = "123" maybe causing excel file crash every time on Save and Close command!!

    Dear Sir/Madam, Good Day!! I'm stuck with a strange problem and can not get any solutions. Problem: I have a macro enabled workbook say ABC.xlsm. I have code in ThisWorkbook for saving the file while closing. Private Sub Workbook_BeforeClose(Cancel As Boolean) ThisWorkbook.Save End Sub and...
  8. P

    Run Workbook_BeforeClose after worksheet_change

    Hello there, I Would like to ask for help with my Excel project. This is my VBA code: Private Sub Workbook_Open() Range("H9").Value = Range("H9").Value + 1 Range("B23:B29").ClearContents Range("name").MergeArea.ClearContents Range("sirname").MergeArea.ClearContents...
  9. T

    Workbook_BeforeClose Event

    If I understand this article correctly: IgnoreRemoteRequests it claims the Workbook_BeforeClose event does NOT necessarily kick off code saved there. Therefore this workaround has been suggested: Its true that if close Excel manually the IgnoreRemoteRequests setting reverts to what...
  10. C

    Combobox change event and workbook close/open

    I hope I can explain this properly. I have a combobox_change sub that amends two fields depending on the value of what's selected. Those fields, however, are unlocked and able to be overwritten by the user. The problem is that this change event seems to be running upon either workbook close...
  11. N

    Closing a save loop with Workbook_BeforeClose(Cancel As Boolean)

    Hello everyone, new guy here. I'm pulling my hair out as I cannot figure this out, no matter how many threads I read on it or tutorials I watch. Here's how this one works. On open, the app checks a location on the drive for a file of the same name. If its there, the workbook closes. If it's...
  12. R

    VBA Workbook_BeforeClose doesn't fire twice in a row

    This is an interesting problem that can be reproduced with only 4 lines of code so I think it might be a bug, unless I am doing something wrong (Which is entirely possible). To recreate the problem, execute the following steps. 1. Open a new workbook 2. Copy the following code into the...
  13. F

    Workbook_BeforeClose not fired the second time on Excel 2016

    On Excel 2016 RTM if I close the Workbook and on the event Workbook_BeforeClose I cancel the closure with Cancel=True when there is only one Workbook open, the second time I close the Workbook, the event Workbook_BeforeClose do not fired. I think this is a bug of Excel 2016. Note...
  14. E

    Problem showing the Ribbon in Workbook_BeforeClose

    I want to hide the Excel ribbon in Workbook_Open then show the ribbon in Workbook_BeforeClose. The Workbook_Open works OK, but in Workbook_BeforeClose, the SendKeys starts Excel Help. In testing, the same "Show Ribbon" code works OK in any module subroutine except Workbook_BeforeClose. Is...

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top