Hello all,
I have a code that requires a user to enter a text before saving the file in order to protect changes to this. The code runs well in protecting the original document, but I also have a macro that would automatically save the file location to something else, which now prompts the inputbox.
My question is: Is there a way to automatically enter the password (in VBA)into this input box once running the macro so that the user does not have to know the password?
Here is my code for saving the file locations to something else:
I have a code that requires a user to enter a text before saving the file in order to protect changes to this. The code runs well in protecting the original document, but I also have a macro that would automatically save the file location to something else, which now prompts the inputbox.
My question is: Is there a way to automatically enter the password (in VBA)into this input box once running the macro so that the user does not have to know the password?
Here is my code for saving the file locations to something else:
Code:
Sub save_as_WB()
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:= _
"[URL="file://\\Parts\CopyOfParts_Inventory.xlsm"]\\Parts\CopyOfParts_Inventory.xlsm[/URL]", _
FileFormat:=xlOpenXMLWorkbookMacroEnabled, CreateBackup:=FalseApplication.WindowState = xlNormal
Application.DisplayAlerts = True
End Sub