ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Open workbook on close (https://www.excelbanter.com/excel-programming/380781-re-open-workbook-close.html)

Mike[_114_]

Open workbook on close
 
If you're talking about closing a specific Workbook then you could use
this

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Workbooks.Open "C:\FileToOpen.xls"
End Sub

This VBA code would need to be placed in the "ThisWorkbook" part of the
file that is being closed.

C_Ascheman wrote:
Is there a way to detect when the small x in the upper right corner of the
worksheet is clicked on, and as it is closing to open a predifined worksheet
up. We have a workbook containing 5 worksheets. A completely blank version of
the workbook is stored on the server. If one of our employees is working on
any of the worksheets with in that workbook, and clicks on the worksheet x is
it possible to open the blank workbook as that old one is closing?

C_Ascheman




All times are GMT +1. The time now is 09:28 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com