Hello,
I've been working on 2 workbooks, one "Master.xlsm" is for inputting of information (Workbook Protected) the other "Viewer.xlsm" is for displaying it in a similar to read-only format (Sheet Protected Only). The main information which is shared between the two is the background color of the cells in the Master Workbook.
After doing some research from different forums I have mixed together this below code which works a charm. The only Problem I have at the moment is when the "Viewer" workbook requests the information it obviously needs to un-protect the "Master" workbook, I have added to the code to do this, however I am still receiving the Input Password Box. It doesn't matter if I leave it blank press ok, or cancel, it will still run the code which is great! But I really don't want that box to come up at all requesting a password as it is unnecessary & will confuse the users.
Is there a way I can at least hide that password box? Help would be greatly appreciated!
I've been working on 2 workbooks, one "Master.xlsm" is for inputting of information (Workbook Protected) the other "Viewer.xlsm" is for displaying it in a similar to read-only format (Sheet Protected Only). The main information which is shared between the two is the background color of the cells in the Master Workbook.
After doing some research from different forums I have mixed together this below code which works a charm. The only Problem I have at the moment is when the "Viewer" workbook requests the information it obviously needs to un-protect the "Master" workbook, I have added to the code to do this, however I am still receiving the Input Password Box. It doesn't matter if I leave it blank press ok, or cancel, it will still run the code which is great! But I really don't want that box to come up at all requesting a password as it is unnecessary & will confuse the users.
Code:
Sub GrabColors()
Dim OMaster As Workbook
Dim Viewer As Workbook
Dim Master As Workbook
Set OMaster = Workbooks.Open("D:\\Master.xlsm", Password:="pass")
Set Viewer = Workbooks("Viewer.xlsm")
Set Master = Workbooks("Master.xlsm")
Application.CutCopyMode = True
OMaster.Activate
Range("B4:NA9").Select
Selection.Copy
Viewer.Activate
Range("B4:NA9").Select
Selection.PasteSpecial Paste:=xlPasteFormats, _
Operation:=xlNone, SkipBlanks:=False, _
Transpose:=False
Master.Activate
Range("B11:NA34").Select
Selection.Copy
Viewer.Activate
Range("B11:NA34").Select
Selection.PasteSpecial Paste:=xlPasteFormats, _
Operation:=xlNone, SkipBlanks:=False, _
Transpose:=False
Range("B4").Select
Master.Activate
Me.Saved = True
Application.CutCopyMode = False
Master.Close
End Sub
Is there a way I can at least hide that password box? Help would be greatly appreciated!