Opening PW Protected File, Strange Behavior

PA HS Teacher

Well-known Member
Joined
Jul 17, 2004
Messages
2,838
I've created an Excel/VBA application where I keep the code in one .xls/.xla file and the Data in a separate .xls file with no code. I like to keep the Data File Password Protected. I need to open the Data File many times, and without being prompted to manually enter the password each time the Data file is opened.

<font face=Courier New><SPAN style="color:#00007F">Set</SPAN> MasterFile = Workbooks.Open(MasterFilePath, <SPAN style="color:#00007F">False</SPAN>, <SPAN style="color:#00007F">False</SPAN>, , "password", "password")<br></FONT>

It was working just fine until recently, but now I am still prompted to enter the password manually.

Both files were created in Excel 2000 on my Vista Lap Top. The following strike me as odd:
1. It used to work.
2. It works fine on another machine running Excel '03 on an XP machine.
3. This confuses me the most. When I add a msgbox, I am not prompted to enter the password manually?

<font face=Courier New> <SPAN style="color:#00007F">Set</SPAN> MasterFile = Workbooks.Open(MasterFilePath, <SPAN style="color:#00007F">False</SPAN>, <SPAN style="color:#00007F">False</SPAN>, , "password", "password")<br> MsgBox "I just opened a passwordprotected file"</FONT>

Any thoughts?
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
I'm still struggling with this. I think it may have to do with me opening the same file multiple times within a relatively short time (less than 2 seconds). I've tried putting in an Application.Wait(Now + TimeValue("00:00:01")) statement, but this only seems to work intermittently.
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,912
Members
452,366
Latest member
TePunaBloke

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