Detect if workbook is readonly
You can check with something like:
If ThisWorkbook.ReadOnly = True Then
or
If Activeworkbook.ReadOnly = True Then
Depending on where the code is.
Duncan wrote:
Hi
I was wondering if there were a simple way to detect if the workbook, when
opened, was opened in read-only mode? The reason for this is that I have
code in place to automatically time-out the book after 5 minutes of
inactivity, but I wouldn't want this to happen if it were opened as
read-only. I would just need to suppress the code in the workbook_open
handler (or insert an if statement to determine if it should be run).
Any help gratefuly received!
Duncan
--
Dave Peterson
|