ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   vba macro open password protected workbook (https://www.excelbanter.com/excel-programming/357531-vba-macro-open-password-protected-workbook.html)

RaY

vba macro open password protected workbook
 
How do I get a Macro to open a password protected workbook without prompting
the user for it? I have several users writing to the same file via macros but
I want to keep their information private from each other.

Greg Wilson

vba macro open password protected workbook
 
Just pass the password as an argument the same as you do with the wb path and
name. Something like this:

Workbooks.Open ThisWorkbook.Path & "\gregtest.xls", Password:="greg"

Regards,
Greg

"Ray" wrote:

How do I get a Macro to open a password protected workbook without prompting
the user for it? I have several users writing to the same file via macros but
I want to keep their information private from each other.


DavidAtCaspian

vba macro open password protected workbook
 
If you press F1 on the word 'open', the help system will also tell you about
various other choices, such as update links, and read only. (If the help has
been installed OK!)

"Greg Wilson" wrote:

Just pass the password as an argument the same as you do with the wb path and
name. Something like this:

Workbooks.Open ThisWorkbook.Path & "\gregtest.xls", Password:="greg"

Regards,
Greg

"Ray" wrote:

How do I get a Macro to open a password protected workbook without prompting
the user for it? I have several users writing to the same file via macros but
I want to keep their information private from each other.



All times are GMT +1. The time now is 09:52 PM.

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