ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Macro's (https://www.excelbanter.com/excel-worksheet-functions/34834-macros.html)

JaneC

Macro's
 
Hi, Is there anyway to stop an Auto_Close macro from running when the file is
in read-only mode? Thanks, Jane

Bob Phillips

Change the macro to test exit

Sub Auto_Close()
If Thisworkbook.Readonly Then
Exit Sub
Else
'do your stuff
End If
End Sub

--

HTH

RP
(remove nothere from the email address if mailing direct)


"JaneC" wrote in message
...
Hi, Is there anyway to stop an Auto_Close macro from running when the file

is
in read-only mode? Thanks, Jane





All times are GMT +1. The time now is 07:47 AM.

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