Opening Password protected Files from Macro

S

sosteffo

Workbooks.Open "c:\my documents\myworkbook.xls", Password:="mypassword"

I have the code above which works, problem is that the file has
passwords one for OPENING and another to MODIFY.


Please could someone provide the missing link/line etc.....i'v
unsuccessfully tried a few variations!!
 
D

DNF Karran

from the xl vba help files:

expression.Open(FileName, UpdateLinks, ReadOnly, Format, Password
WriteResPassword, IgnoreReadOnlyRecommended, Origin, Delimiter
Editable, Notify, Converter, AddToMRU)

So the missing part of your code is: WriteResPassword:= "ABC"

You might also need: IgnoreReadOnlyRecommended:= true

Dunca
 
V

vikram

i have an add-in which can solve ur problem. Install it and u will b
able to break all passwods.
it will work for excel files only
 
Top