Help with System.ArgumentException: The workbook does not exist

Issue:
I get the System.ArgumentException: The workbook does not exist runtime error
image

Background
I have a custom activity (it works on my local machine before deploying it). This activity has an in_arguement (type String) that asks the user to specify the location of an excel file to be read in. See below for the screenshot of the custom activity:

I’m using this custom activity as a dependency in another process. Whenever I provide value to the in_arguement (the location where to read the excel file), I get The workbook does not exist error message. Below is where I’m using the custom activity in another workflow and providing value to the in_arg.

Also see detail of the error log below.

22.10.5+Branch.support-v22.10.Sha.79bc7c61a909d990afd07620b3005b3a35eb1f1b
Source: formatAndPostCLineTrans (Read Patient And Unit Numbers)
Message: The workbook does not exist

Exception Type: System.ArgumentException

System.ArgumentException: The workbook does not exist at UiPath.Excel.WorkbookFile…ctor(String workbookPath, String password, Boolean createNew)
at UiPath.Excel.Activities.WorkbookActivity1.ConstructWorkbook(String path, String password, Boolean createNew) at UiPath.Excel.Activities.WorkbookActivity1.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)

Hi,

Can you tell us in which the xlsx file exists, under the project folder or the library folder?

Regards,

Hi @Yomi_Oluwadara,

Check if the path is given without any mistakes and also check if the bot has necessary permissions to read the file from the particular path.

Also, try giving the exact same path that worked in attended more to figure out and understand the issue in detail.

Hope it helps!

Cheers

Thanks @Yoichi
The xlsx exists under the project folder. I was just passing the path to the xlsx as the value to the in_arg from the custom activity I built and hade deployed.
image

HI,

For now, can you try to pass file path as absolute path as the following?

System.IO.Path.Combine(System.Environment.CurrentDirectory,"data\pre_reg_patid_and_unit_numbers.xlsx")

Regards,

@Gayathri_Ramanathan Thank you, The path to the xlsx is correct. Since the process where I’m using the custom activity is not yet deployed to the enterprise bot, I believe my bot should be able to have access to that file. It does exist on my local machine.

Whenever I read the file from the location( a shared network drive) where it worked - before deploying it as a custom activity, it worked!

Does it mean that custom activities can not read file from an internal prpject location? I’m a little lost

@Yoichi Thanks, this worked!

1 Like

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