Password Excel Documents (VB)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • AJHY
    New Member
    • Feb 2008
    • 18

    Password Excel Documents (VB)

    Hi

    Wondered if anyone can help. I am trying to open an excel docuement which is sent externally. Sometimes the same document can contain the password in both upper and lower case. Is there a way to open it through VB regardless of case?

    The code I am currently using is

    Batley_and_Spen = "G:\OPS\Contrac ts_and_Monitori ng\Management_I nformation\Home Care Database\Transf ers\2008-2009\Wk01_01_04 _08\Batley_and_ Spen.xls"
    Workbooks.Open Batley_and_Spen , , , , "ABC123" Or "abc123", "abc123" Or "abc123"

    Thanks

    Andy
  • kadghar
    Recognized Expert Top Contributor
    • Apr 2007
    • 1302

    #2
    Originally posted by AJHY
    Hi

    Wondered if anyone can help. I am trying to open an excel docuement which is sent externally. Sometimes the same document can contain the password in both upper and lower case. Is there a way to open it through VB regardless of case?

    ...

    Thanks

    Andy
    While defining passwords, use UCASE function, while reading them use it too.

    But of course, if you're trying to open a file with an already set password, i'd hate it if you could skip the Case Sensitive just like that. Case sensitive passwords are not bugs, they are features for increasing security.

    Comment

    Working...