Macro problem trying to open workbook

shrek

Board Regular
Joined
Dec 16, 2005
Messages
244
I have a macro that im trying to open a workbook with which is shown below.


Workbooks.Open Filename:="R:\c2c\SUMMARY.XLS", UpdateLinks:=3
Password = "trumpton"
End Sub

The trouble im having is that it keeps asking for the password BEFORE it open the workbook. Can anyone help?

Many Thanks
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Hello,

Try something like this, on one line.

Code:
Workbooks.Open Filename:="R:\c2c\SUMMARY.XLS", UpdateLinks:=3, writerespassword:="trumpton"

nice password - always preferred Camberwick Green! :biggrin:
 
Upvote 0
Tried that but didnt unfortunally work. I assume that I was correct in putting the macro in the workbook where I want to open it from? Unfortunally it still askes for password. Could it be that the workbook its opening is unprotected already? Im just trying to get it so it dont keep asking for the password before it opens it.
 
Upvote 0
Hello,

What happens when you open the workbook manually? Does it ask for a password?

Which workbook is this code in? is it the SUMMARY.xls, or another one?
 
Upvote 0
When I open the workbook manually it asks me for the password and when I input it opens the summary workbook ok. The macro is in a workbook called "passacc" which it opens from using a macro button
 
Upvote 0
Hello,

WHen you open the workbook, on the password entry, is it giving you the option to Read Only, If not try

Code:
Workbooks.Open Filename:="R:\c2c\SUMMARY.XLS", UpdateLinks:=3, password:="trumpton"
 
Upvote 0
Many Thanks

I tried that but it didnt wanna have it unless I typed in something wrong.
 
Upvote 0

Forum statistics

Threads
1,214,952
Messages
6,122,454
Members
449,083
Latest member
Ava19

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