Solved

How to open a password protected file

Posted on 2013-01-28
3
373 Views
Last Modified: 2013-01-28
Hi Exparts,
I have a excel file to create reports from different sheets of the excel workbook and some infromation from an external worksheet.
But the external worksheet is password protected therefore, each time excel refresh data in every 20 miniutes try to open the extarnal excel sheet every its stop there to choose as read only. Is there any way to bypass this message while open the external excel worksheet.
 I wrote as below but still stopped "Enter password for write access,or open read only"  
Set wb_Source = xl.Workbooks.Open(FileName, IgnoreReadOnlyRecommended:=True)

Please advise how bypass this message while opening password protected worbook to get some information.

Thanks
0
Comment
Question by:alam747
  • 2
3 Comments
 
LVL 26

Accepted Solution

by:
redmondb earned 500 total points
ID: 38829620
Hi, alam747.

What about including ReadOnly:=True as well?

Edit: So your line becomes...
Set wb_Source = xl.Workbooks.Open(FileName, IgnoreReadOnlyRecommended:=True, ReadOnly:=True)

Regards,
Brian.
0
 

Author Closing Comment

by:alam747
ID: 38829694
Thanks a lot, it works
0
 
LVL 26

Expert Comment

by:redmondb
ID: 38829711
Thanks, alam747.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
VBA Array, write each column's start position into an array 17 36
DHCP Server 14 65
Excel Automation VBA 19 37
Dynamic Filter ? 4 21
Possible fixes for Windows 7 and Windows Server 2008 updating problem. Solutions mentioned are from Microsoft themselves. I started a case with them from our Microsoft Silver Partner option to open a case and get direct support from Microsoft. If s…
How to record audio from input sources to your PC – connected devices, connected preamp to record vinyl discs, streaming media, that play through your audio card: Vista, Windows 7, Windows 8, Windows 8.1 and Windows 10 – both 32 bit & 64.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now