Apologies if this is a duplicate but I couldn’t seem to find an answer.
I have run into problems when getting UIPath to access password protected documents. My current project required me to open a password protected Excel sheet, but each approach I have tried has yielded no results.
This is what I have tried so far;
Enter the password into the Password property of Excel Application Scope.
Enter the text once the password box appears.
Click within the password field once it appears and type the password.
Record the steps required to focus on the password field and enter the password.
I hadn’t tried that, but doing so offers this error and I’m not sure it would be fit for purpose in my case.
[details=Error Message]Main has thrown an exception
Message: Part is not a compound document
Source: Read range
Exception Type: InvalidDataException
System.IO.InvalidDataException: Part is not a compound document
at OfficeOpenXml.Utils.CompoundDocument.Read(ILockBytes lb)
at OfficeOpenXml.Utils.CompoundDocument.Read(Byte doc)
at OfficeOpenXml.Utils.CompoundDocument.Read(FileInfo fi)
at OfficeOpenXml.Encryption.EncryptedPackageHandler.DecryptPackage(FileInfo fi, ExcelEncryption encryption)
at OfficeOpenXml.ExcelPackage.ConstructNewFile(String password)
at OfficeOpenXml.ExcelPackage…ctor(FileInfo newFile, String password)
at UiPath.Excel.WorkbookFile…ctor(String workbookPath, String password, Boolean createNew)
at UiPath.Excel.Activities.WorkbookActivity`1.BeginExecute(AsyncCodeActivityContext context, AsyncCallback callback, Object state)
at System.Activities.AsyncCodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.ActivityInstance.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)[/details]
I have tried to use this “Password” property of Excel Scope, and also the “Password” property under the Workbook activities. Both of them weren’t able to unprotect the excel file.
I made my own custom activity just to unprotect the excel file.
Here is a protected dummy excel file to simulate it. dummy.xlsx (12.5 KB)
The password is “uipath” (lower case).
Once again here you have to use “Read Range” activity of workbook.It will work for you. for me it is working
@badita@Gabriel_Tatu@adrian Have to check why Excel application scope is not communicating well with this scanerio. Faced some issues earlier as well. it is returning UI pop up to again enter the password.
there are no known issues on this topic, it works as expected.
now, i do have some questions for you:
-have you tried with other xlsx file? only this one does not work?
-the password is for the entire document, right?
-what excel version do you have installed on the test machine?
-can you send us the test file for us to try?
thank you.
We’ve had this here once or twice, nothing I’ve found has ever successfully opened a spreadsheet post Excel 2010. if the password is any longer than 4 characters and more than just a dictionary word, good luck, I hope you have a patient attitude, because it can take weeks of brute force dictionary attacking, even utilising some dodgy software that can use a high end GPU for raw number crunching.
Id suggest if its not ultimately business critical, slap the user and tell them you’ll learn next time to NOT forget it.
Brutal but necessary, you really dont want to be pulled into this kind of task, its painful.