Protecting and Un-protecting Workbook

Robert_Conklin

Board Regular
Joined
Jun 19, 2017
Messages
173
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
Currently I have a workbook that my end users fill out and submit to make changes to spare part info. When I receive the workbook I transfer the data to a repository file that is used as a search tool. Currently the repository file can be accessed by my end users, but some of them make changes to the repository and make it impossible for the other end users to use it. Because of this, I would like to protect the repository file. I would like to modify my transfer code so that the protection will be removed from the "Master Parts Repository 2018" workbook so that my transfer can occur, but then restore the protection and save the file. Any help would be greatly appreciated. Below is my transfer code.

Code:
Sub DataTrAll_REP()Application.ScreenUpdating = False
   fpath = "C:\Users\Robert.Conklin\OneDrive - Flowers 
   fname = "MASTER PARTS REPOSITORY 2018.xlsx"
   Set dWB = Workbooks.Open(fpath & "\" & fname)
Call DataTrAEtoAE_REP
Call DataTrAUtoAU_REP
Call DataTrBLtoBL_REP
Call DataTrDCtoDC_REP
Call DataTrIOtoIO_REP
Call DataTrMMtoMM_REP
Call DataTrMTtoMT_REP
Call DataTrNDtoND_REP
dWB.Sheets("ADD-EXTEND").Activate


Cells.AutoFilter


Application.ScreenUpdating = True
End Sub
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.

Forum statistics

Threads
1,223,246
Messages
6,170,988
Members
452,373
Latest member
TimReeks

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top