General discussion


Macro to input password for read only workbooks

By gruple ·
I have several workbooks that I need to open and recalculate often. All of these workbooks are read only is you don't have the password. I want write a macro to open all of these workbooks and to automatically enter the password as they open instead of me typing it in 50 times. I have tried searching the database, but I can't find anything that has worked. I know how to make the macro to open the workbooks, I just don't know the syntax to enter the password. Any help will be very very appreciated.

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Comments

Collapse -

macro code

by dusemre In reply to Macro to input password f ...

For workbook protection
active.workbook.password ("password")

For worksheet protection
active.worksheet.password ("password")

Note: do not omit " in the password field, write your password inside ("")

when writing the code dont forget to choose worksheet, example:

sheet name is SKOR
sheet password is 123456

ActiveSheet.Unprotect ("123456")

Related Discussions

Related Forums