View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
BEEJAY BEEJAY is offline
external usenet poster
 
Posts: 247
Default Read Write Programming

Greetings All:

I need to protect various workbooks sent out to salesmen.
I have the standard protection set up. I then made the files read only, but
this is interfering with a number of my macros.
None of the users are accostomed to accessing files thru "file Open", or
such like.
They are used to double clicking on the desired template master, which then
opens Excel AND the required file.
Is there a way I can insert a ReadOnly = False and a ReadONLY = True
statement, or something like that, in the following?

Option Explicit
Sub CdnContract()
' CdnContract Macro
Dim myBook As Workbook
Application.ScreenUpdating = False
Application.EnableEvents = False
Set myBook = ActiveWorkbook
Sheets("Contract").Activate
ActiveSheet.Unprotect Password:="XXXX"
Range("I2:L3").Select
Selection.Copy
Range("B2").Select
ActiveSheet.Paste

With myBook
.Save
End With

Application.EnableEvents = True
Application.ScreenUpdating = True
ActiveSheet.Protect Password:="XXXX"

End Sub