Issue with protected excel files

Hello community,

I have a critical issue with Studio.
My process is saving email attachments locally and then opens them (using a str var for password value -if provided) to unprotect them, wherever is necessary.

The process is working fine for files that are NOT protected and also fine for protected files that we already know the password value.

The issue arises when the password is not provided to the bot and tries to open the excel, using the ‘Use Excel’ activity.
At that point the process is stuck (running) with last log message ‘Audit: Using Excel file…’

Tried already:

  1. Try catch does not work
  2. Excel Process Scope outside the Use Excel File, does not have a Timeout property, so not working
  3. Parallel branch NOT working, as the execution is stuck in excel usage

Can you please provide any help?

Thanks!

1 Like

Hi @ioannis - Since you are providing the password to the bot (Assume you are passing value to Inputvar of type string), it would be better to check the variable value first. If it empty, then don’t open the excel, else do other steps. The validation can be done with If activity

Condition - String.isNullorEmpty(Inputvar)

Then>> Do Nothing

Else>> Perform other steps
1 Like

Thank you for replying @ushu

The thing is that the password value is not a required input, thus we don’t know prior if the files need a password to open or not.
By applying the suggested solution, I wouldn’t know which files needed unprotection and which not.

It is critical to unprotect them.

regards,

@ioannis I tried the same scenario by providing the wrong password in opening the excel. It throws an exception. Can you check the below workflow and see that helps

SampleProcess.zip (13.6 KB)

Also, the actual password is set to 1234

2 Likes

@ioannis

You can use a parallel activity with excel scope on right and a timeout activity on left.and set the a boolean variable to true after the timeout…and also the same boolean can be set to true on the excel scope after the excel process scope is complete and use this varible in the condition of parallel…that way even if one of it is completed parallel will try to end execution

Cheers

Hi @ioannis ,

Does the issue arise when you have a Password Protected file and you give the wrong password to it ?

Or

Does it happen when you provide a password/Empty value to an Excel file when there is no need of providing the password as it is not protected ?

Maybe there is still to be understood from the Situation, but we could try the below by Implementing the Reading of the file in a Try Catch activity :

  1. Firstly you can try reading the file without a Password (The Reading part should in the Try part), if it throws an Exception, In the catch part you can then use the Read activity again with the Password passed to it and then try to read the file.

For this scenario to work it is assumed that Only one kind of password needs to be provided if a file is protected else the file should be unprotected.

1 Like

hello @Anil_G

The thing is that when using the parallel activity, at the time the wf is executing the opening of the excel, the run is stuck, so the parallel actions can not be executed.

I think another option could be the Parallel Process invokation…

Thank you for the reply!

1 Like

hi @supermanPunch

I figured out that the issue comes, when I pass an empty value as Password while opening the excels.

When the Password var is correct, the excel opens normally and the execution continues.
When the Password var is NOT correct, there is an exception from UiPath.
When the Password var is “” (empty), the using excel never ends- (the wf is running forever)

So, based on the above i will try adding a check for the Pass var, before executing the excel actions.

Thanks for the reply!

1 Like

Hello @ushu

Thanks for the help!!

Due to the sample you sent, i noticed that xthe issue occurs because i pass an empty value as Pass.

I added a check before opening excels, so the empty values are converted in a ‘dummy’ value.
This way the excel scope results in exception which i catch to recognise the cases.

Thanks again!

ATTENTION TO ALL!

When you pass an empty Password var for using an excel that is protected, then the execution of the workflow is stuck (keep running without being able to throw an exception).

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.