S
sam
Hi All,
I have a protected workbook which is updated through a userform and then
saved at a different location, I have everything working but one thing.. When
I save it again at a different location I want it to be unprotected, Here is
the piece of code I have to do that, but the workbook is still protected.
please help!
Set wbk = Workbooks.Open("C:\Documents\My_Sheet.xlsm", False, False, ,
"password")
FPath = "C:\Documents\My_Sheet\" & "New_Sheet" & "-" & ".xlsm"
'Code to populate the worksheet goes here
With wbk
..Unprotect "password"
..SaveAs FPath
..Close True
End With
I have a protected workbook which is updated through a userform and then
saved at a different location, I have everything working but one thing.. When
I save it again at a different location I want it to be unprotected, Here is
the piece of code I have to do that, but the workbook is still protected.
please help!
Set wbk = Workbooks.Open("C:\Documents\My_Sheet.xlsm", False, False, ,
"password")
FPath = "C:\Documents\My_Sheet\" & "New_Sheet" & "-" & ".xlsm"
'Code to populate the worksheet goes here
With wbk
..Unprotect "password"
..SaveAs FPath
..Close True
End With