Read Write Programming

B

BEEJAY

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top