View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
carlo carlo is offline
external usenet poster
 
Posts: 367
Default VB code to tell if my sheet is read-only

Hi Kevin

Try this:

Private Sub Workbook_Open()

If Not ActiveWorkbook.ReadOnly Then
'your code to close the book in 2 hrs
End If

End Sub

hth

Carlo


On Jan 10, 8:59*am, Kevin wrote:
Hi

I want to run code only if the workbook is live (ie not read-only). I have
set the workbook to advise users to open it read only but If they choose to
open edit then I want to force a close after 2 hours ( I have the code for
this).

is this very simple?
--
Kevin