ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel - BeforeClose Problem... (https://www.excelbanter.com/excel-programming/277677-excel-beforeclose-problem.html)

Al Mackay

Excel - BeforeClose Problem...
 
I have the following problem with an Excel Spreadsheet that I use.

Need to be able to get round an issue that is caused by where the
Excel file is stored. The excel file is attached against a Lotus
Notes program.

I have a macro that runs when the file is closed down currently, but
when this is opened in Read Only through Lotus Notes window it causes
Excel to crash and one of the following error message usually occurs
(Run time error 9 or Run time error 1004)

I don't know if this is possible, but one way to get around this would
be to have the following criteria applied to the macros?

1) When Cell A1 within Doc Sheet 1 has data in, once the work book is
closed Protect the whole workbook and password protect.

2) When the sheet is opened in 'Edit' mode allow Private Sub
Workbook_BeforeClose to run when the sheet is closed but then delete
it.

Therefore what will be happening is the macro BeforeClose will almost
be generated on the fly

Many Thanks, Al. ( )


All times are GMT +1. The time now is 04:34 AM.

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