View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Barb Reinhardt Barb Reinhardt is offline
external usenet poster
 
Posts: 3,355
Default Code based on opening Read Only or not

If you are referring to your opened workbook as oWB, use something like this

if oWB.ReadOnly then
'Do read only stuff
else
'Do edit stuff
End if

HTH,
Barb Reinhardt

"Craig" wrote:

Hi

When a user opens my file they see the standard password box in which they
can either click the Read Only button and work in it as Read Only or enter
the password and work in it with write access.

Is there macro code I can enter in the same file that would hide a group of
worksheets if the user opens that file with write access but would not hide
these worksheets if they open the file as Read only?

thank you very much.....Craig