Macro to open password protected workbook..

Andy D 2002

Board Regular
Joined
Apr 22, 2002
Messages
106
hi
what code do i need to get a macro to open a password protected workbook if password to open is say "123"?
thanks
Andy
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
On 2002-04-30 01:14, Andy D 2002 wrote:
hi
what code do i need to get a macro to open a password protected workbook if password to open is say "123"?
thanks
Andy

Andy try
Workbooks.Open Filename:="C:NavKeys.xls", password:="123"
 
Upvote 0
hi I am not familliar on using vb code. can you please help me whats the whole code ? that I can use to open password protected workbook
 
Upvote 0
Press Alt+F11 and then add module & then write

Sub open_file ()
Workbooks.Open Filename:="C:NavKeys.xls", password:="123"
End sub
 
Upvote 0
Press Alt+F11 and then add module & then write

Sub open_file ()
Workbooks.Open Filename:="C:NavKeys.xls", password:="123"
End sub


Hi its still not working , the file name of this excel is HELLO so I change Navkeys to Hello, but still not working . If its possible can you just send me the excel file that I can use . Sorry I am really dumb on this I just need this excel file ..
 
Upvote 0
Try now

Sub open_file ()
Workbooks.Open Filename:="C:\Hello.xls", password:="123"
End sub
 
Upvote 0

Forum statistics

Threads
1,213,527
Messages
6,114,142
Members
448,551
Latest member
Sienna de Souza

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top