ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Read Write Programming (https://www.excelbanter.com/excel-programming/359751-read-write-programming.html)

BEEJAY

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




All times are GMT +1. The time now is 01:30 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com