ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Open Workbook - Password (https://www.excelbanter.com/excel-programming/399079-open-workbook-password.html)

J.W. Aldridge

Open Workbook - Password
 
Got this macro, but it still prompts for password.


Any clues as to why?


Sub Macro7()
'
' Macro7 Macro


Workbooks.Open Filename:="X:\FHI Share\pcp\NEW PCP DATA.xls",
PASSWORD:="pcp123"


ActiveWorkbook.Save
ActiveWindow.Close


End Sub


AccessHelp

Open Workbook - Password
 
May be, the password for "NEW PCP DATA.xls" is not "pcp123". Are you sure it
is "pcp123"?

"J.W. Aldridge" wrote:

Got this macro, but it still prompts for password.


Any clues as to why?


Sub Macro7()
'
' Macro7 Macro


Workbooks.Open Filename:="X:\FHI Share\pcp\NEW PCP DATA.xls",
PASSWORD:="pcp123"


ActiveWorkbook.Save
ActiveWindow.Close


End Sub



J.W. Aldridge

Open Workbook - Password
 
Super certain. (I created it and use it every hour.)



any clues?


Bill Renaud

Open Workbook - Password
 
Does the workbook have passwords for both Open and Modify? If you entered
passwords for both, then your macro is only supplying the first one. You
may also need to supply the WriteResPassword parameter in the Open method.

--
Regards,
Bill Renaud





All times are GMT +1. The time now is 02:53 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com