lezawang
Well-known Member
- Joined
- Mar 27, 2016
- Messages
- 1,805
- Office Version
- 2016
- Platform
- Windows
Hi
I understand the code below, thanks for you help. but I am wondering if I can do the same without physically opening the file? is that possible?
Sub openandpwd()
Dim x As Workbook
Set x = Application.Workbooks.Open("C:\abc.xlsx")
x.Password = InputBox("enter pass")
x.Close
End Sub
source: https://docs.microsoft.com/en-us/office/vba/api/excel.workbook.password
I understand the code below, thanks for you help. but I am wondering if I can do the same without physically opening the file? is that possible?
Sub openandpwd()
Dim x As Workbook
Set x = Application.Workbooks.Open("C:\abc.xlsx")
x.Password = InputBox("enter pass")
x.Close
End Sub
source: https://docs.microsoft.com/en-us/office/vba/api/excel.workbook.password