Getting exception while using custom Library

Hi all,

I am trying to read an excel file using library.

ReadConfig.xaml is my library package file which I am using in another project Main.xaml
I have used an xlsx file with 2 columns F_Name and L_Name

When I am executing my program, it is giving error - “ReadConfig: Column ‘L_Name’ does not belong to table DataTable.”

Strangely when I try to execute Read config program without using library, it gives perfect result.

Can anybody help me out where I am making error.

ReadConfig.xaml (10.4 KB)
Main.xaml (6.2 KB)

Hi @Shuchi_Gupta,

Without correct dependencies and the source library the forum cannot test your Main.xaml
We cant confirm what excel workbook/sheet should both these workflow use.
A your library nuget and a sample excel workbook could help resolve this issue faster.

As per the error : “ReadConfig: Column ‘L_Name’ does not belong to table DataTable.”

Your library / ReadConfig.xaml and Main.xaml are hardcoded to look for F_Name and L_Name columns in input excel workbook/sheet? Remember if those excel sheets you are using as inputs have header with spaces F_Name OR L_Name you can also get this error.

Attached are the nuget file and excel.ConfigFile.xlsx (7.7 KB)
TestPackage.1.0.9.nupkg (28.3 KB)

I tried using index number also instead of column name (F_Name and L_Name), but still it gave error while detecting 2nd column name.

Hi again,

I tested with your package and the ReadConfig.xaml. I think the error resides in the C# code.
As you noted, both read range does the job as expected. I think you have to confirm within C# if the code read the contents of the whole Sheet1 or not. C# activity has read F_Name as a column.

As this activity is not sensitive information, you could also share the C# code of your activity.cs.

  1. Where can I find activity.cs file?

  2. Also attached the file where I am executing the same standalone program and it is giving result whereas when I am calling it using library, it is not able to find the column.
    ReadConfigTest.xaml (9.4 KB)

Hi @Shuchi_Gupta,

When I said activity.cs I meant the name of the activity you developed in C# not exactly activity.cs.

The custom library was developed in C# right? From your custom library package i see your activity in C# is named as ReadConfig.cs.

In ReadConfig.cs you have to find where the input excel file path is being read and if it is read in the correct manner.

Your ReadConfig.cs activity takes 2 inputs ConfigFileName as string and ConfigSheetName as string. Without looking at the source code, I dont think anyone else can help you fix the issue. As I said before, the error source is in the custom library (the TestPackage.1.0.9.nupkg)


Can you try to set “” or “A1” at Range property of Read Range Activity in ReadConfig,xaml?
For some reason, it seems blank doesn’t work in library properly. (It might be a bug…)

TestPackage.1.0.15.nupkg (28.3 KB)


@jeevith attached file

ReadConfig.xaml (10.4 KB)

@Yoichi - Setting Range property to “” in package file did solve my issue. I was able to retrieve values.


1 Like

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