Forum Discussion

siv_arunprakash's avatar
siv_arunprakash
Contributor
8 years ago
Solved

How to open a password protected excel workbook in TestComplete?

I used the following JavaScript:

 

var Excel= Sys.OleObject("Excel.Application");

Excel.Workbooks.Open(filename, 0, false, 1, "password");

 

This script worked, But if I set the "password" string in a variable of type password and I pass it to function Excel.Workbooks.Open(); TestComplete doesn't decrypt the password variable. 

 

How do I decrypt the password variable or pass it into Open function and in TestComplete docs they mention passing it using only SetText or Keys but that doesn't help in this case. 

  • You can also do this:

    Project.Variables.password.DecryptedValue

     

    This will return the Decrypted value of your password variable.

  • baxatob's avatar
    baxatob
    8 years ago

     

    .DecryptedValue - it's amazing! :) I am surprised why it is not documented...