Is it possible to read the multiple sheets using for each data table

Someone please help in this. Need it urgently. I want to read the date from the multiple sheets.
Here I am trying to fetch the email id’s from all the sheets. Employee details are stored in excel by monthwise and I want to fetch the email id’s from all the sheet.

Please find the below screenshot, where I am fetching the sheet name using control flow for each and reading the content of the every sheet by adding the for each data table. But it is giving me the error, saying one of the column name which I am looking for is not exists, even though it is present in the sheet and the name is also proper.

Please post your excel file and xaml file

Hi @Namratha_Nayak,

Check this link, similar to the code you are looking for,



Please find the attached xaml file and the sheet.
Main.xaml (14.3 KB)

Employee Birthday Details.xlsx (205.1 KB)

Your sheet can be modified…the headers can be shifted to first row. Is that possible to do?

@Niket_Ghai, I cannot modify the sheet. Since the sheet for which I am modifying this is in the same format, it is not allowed to modify. :frowning:

Main (4).xaml (14.3 KB)

Try This!

No luck… Getting the same error. :frowning:

I didn’t get this point. Could you please explain me.

Works like a charm for me and a friend. Did you run my worklow or you made changed in yours?

I am running your changes.

this is the result you want right?
IDK what’s wrong. Please keep your excel file closed before running the workflow…

1 Like

Yes exactly… Why it is not happening for me :cry:

You have added the column “B2” in that right? But why it won’t work “” with this?

Yes it’ll work for B2 as your excel sheet starts there…when it’s “” it reads headers blank…that is why it was giving that error to you…

1 Like

Try running this @Namratha_Nayak

Main.xaml (13.6 KB)


I think issue was with my sheet, I have sent you the part of the excel. In the actual excel file, the last two sheet didn’t had blank row and column.

Now as you have suggested, I have shifted the headers to first row. But getting some other problem. Could you please check my xaml file once.

Main.xaml (12.5 KB)

Same one got from @Niket_Ghai. Thanks for the response.

Is it working for the part of excel which you sent us??Employee Birthday Details.xlsx (205.1 KB)

This Excel file…

Now getting the following error, According me all the objects are intialized. Could you please check my xaml file once.

Main (4) has thrown an exception

Source: Assign

Message: Object reference not set to an instance of an object. This error usually occurs when using a variable with no set value (not initialized).

Exception Type: NullReferenceException

System.NullReferenceException: Object reference not set to an instance of an object.
at lambda_method(Closure , ActivityContext )
at Microsoft.VisualBasic.Activities.VisualBasicValue1.Execute(CodeActivityContext context) at System.Activities.CodeActivity1.InternalExecuteInResolutionContext(CodeActivityContext context)
at System.Activities.Runtime.ActivityExecutor.ExecuteInResolutionContext[T](ActivityInstance parentInstance, Activity1 expressionActivity) at System.Activities.InArgument1.TryPopulateValue(LocationEnvironment targetEnvironment, ActivityInstance activityInstance, ActivityExecutor executor)
at System.Activities.RuntimeArgument.TryPopulateValue(LocationEnvironment targetEnvironment, ActivityInstance targetActivityInstance, ActivityExecutor executor, Object argumentValueOverride, Location resultLocation, Boolean skipFastPath)
at System.Activities.ActivityInstance.InternalTryPopulateArgumentValueOrScheduleExpression(RuntimeArgument argument, Int32 nextArgumentIndex, ActivityExecutor executor, IDictionary2 argumentValueOverrides, Location resultLocation, Boolean isDynamicUpdate) at System.Activities.ActivityInstance.ResolveArguments(ActivityExecutor executor, IDictionary2 argumentValueOverrides, Location resultLocation, Int32 startIndex)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)

This file you sent seems absolutely fine to me!
Only keep this in mind-

If you have not moved the columns

just put “B2” in the range!

If you have moved the columns to the left most

leave it blank!

Its working for me.You dont need to change anything else!

1 Like