?
Solved

How to open a password protected file

Posted on 2013-01-28
3
Medium Priority
?
382 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 26

Accepted Solution

by:
redmondb earned 2000 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

After seeing numerous questions for Dynamic Data Validation I notice that most have used Visual Basic to solve the problem. This suggestion is purely formula based and can be used in multiple rows.
In the absence of a fully-fledged GPO Management product like AGPM, the script in this article will provide you with a simple way to watch the domain (or a select OU) for GPOs changes and automatically take backups when policies are added, removed o…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…

777 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