This is my first topic so sorry if I’m not in the right place
I’m trying to open a excel file (.xls) that is password protected using readrange (not ExcelReadRange) and it fails with the following error:
Main has thrown an exception
Source: Process MUMSS file: Read range
Message: Invalid document. EncryptionInfo or EncryptedPackage stream is missing
Exception Type: InvalidDataException
System.IO.InvalidDataException: Invalid document. EncryptionInfo or EncryptedPackage stream is missing
at UiPath.Core.Activities.InvokeWorkflowFile.EndExecute(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.System.Activities.IAsyncCodeActivity.FinishExecution(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
Workaround I have found so far:
remove the password on the xls file
keep the password but change the format to xlsx
For reasons that are a beyond this topic, I don’t want to use ExcelReadRange, so my questions are:
Is this a bug in UiPath? Can it be fixed?
I’ll open another topic on why I dont useExcelReadRange
Thanks for your quick reply.
I confirm that Uipath.Excel.Activities package is installed however I do not understand your second statement:
If you mean that the password as to be provided, then yes, it is provided. (if I don’t provide it I get a different error message).
I’m not sure how you were getting either of them to work as-is. You are using the read range activity, but are not containing it within an excel application scope. Therefore there is no way to input the password for uipath to open the file.
I updated your workflow and just put the read range in an excel application scope and used the password “test” and everything worked perfectly. Main.xaml (13.7 KB)
EDIT: Sorry I didn’t read the whole post as I was just linked halfway through, so I didn’t realize you didn’t want to use excel application scope. Is the reason for this because your computer the robot runs on doesn’t have Excel installed? That is the only reasonable reason I could see why that’d be unacceptable.
I don’t believe it’s possible to use the read range activity on an excel file with a password without having it contained in the excel application scope. I am getting errors for both the .xlsx and .xls files when trying to run your sample workflow.
Edit: Also, if the excel is in “open as read-only” mode, the excel application scope doesn’t save the changes and doesn’t fail. so we don’t know that it was not saved…
we have those 2 options set on the destination excel file for business reasons and can’t remove them.
If I run the Working sequence, I get an error that the File contains corrupted data. Exception Type: FileFormatException. I tried re-downloading and got the same error. I’m assuming this is because it is trying to read the file without using Excel. However, the password is encrypting the data, so UiPath thinks it is corrupted
If I run the Not Working sequence, I get Exception Type: JsonSerializationException. The message says that ISerializable type ‘NPOI.Util.RecordFormatException’ does not have a valid constructor. I’m assuming that for whatever reason UiPath thinks this file is JSON file. Might be the structure? Not really sure…
Either way, they both opened fine when contained in an excel scope. As for the excel pop-up, I would recommend disabling that on all your robot computers and also doing parallel activities to handle it, but there are a ton of different solutions to fix it. I didn’t read through the entire thread linked, but I did see they gave some incorrect advice. You’ll want to include a parallel sequence with the Excel application scope on the left and a sequence on the right that checks for the pop-up with element exists, then use an if activity to click it if it pops up. Another alternative would be to open your excel files using powershell or invoke code and disabling links so it won’t pop-up. It is the second parameter in workbooks.open method as specified here: https://msdn.microsoft.com/en-us/library/microsoft.office.interop.excel.workbooks.open.aspx
For the working sequence, is excel able to open the file?
Also, I think we are not running on the same version, this is why we have a different behavior:
I’m running on Windows 10 Pro 64b, UiPath 2018.1.3, .net 4.0.30319.42000.
What do you have? I can try to set up the same here and see if I get the same error
As for the password, it is set in the readrange/options/password text box so it should not be related to this (except if you don’t have the same version )
For the not working sequence, again I think this may be related to the environment we are using, so if you can give me your OS/UiPath version/.net version I’ll be more than happy to test on my side
Last but not least for the excel popup: the parallel sequence doesn’t work and still get stuck (seems that no one managed to make it work). ExcelIssueV2.zip (121.3 KB)
The good news is that the link you gave me is very useful and I’ll try to implement it.
Interesting. Didn’t realize the non-excel read range activity ever had the option for password. I’m using the UiPath.Excel.Activities package version 2.0.6526.16321 and the newest version is now 2.3.6682.26635 so maybe that’s it? I think read range is part of the excel activity pack & all other activities are up to date except database and mail activities which aren’t related.
I’m running on a windows 7 64-bit UiPath 2018.1.2 and the same .net as you. I wouldnt think the OS has anything to do with it, but it’s definitely possible.