Error in merging multiple excel files

i am getting this error while performing merging operationCapture Capture1 Capture2 can anyone here help me?

regards,
Kaavya.

1 Like

@Are you sure the FolderPath has any values?

Capture3

@kaavya Can you print the FolderPath variable in a message box after MainDT assignment, i just need to check whats in Folder Path afteris assigned.

Capture4

Hi,
Can u attach properties of Merge Data Table Activity…?

Fine
this error usually occurs when the activty having this error has a variable with null value in it
so the item.tosting is obtained from the variable passed to for each loop and that variable is FolderPath which is a string array variable

–i hope the string array doesnt have any value in it
to validate that use a message box in front of this for each loop and mention like this
FolderPath.Count.ToString
if the value shows more than 0 or atleast 1 then we are good
else we need to check with the folder path that we have mentioned has any excel file in it

you are almost done
Hope this would help you
Cheers @kaavya

here it isCapture5

@kaavya here lies the problem, The folder Path is an array of String. Where actually it should have printed the file path.

@kaavya kindly try this and share the screenshot of the output buddy

Cheers

1 Like

okay,let me check and know you

Capture6

I guess the structure of target datetable (MainDt) and the source datatable are not matching…

how to do it now?

Fantastic
Kindly try with a Excel application scope and pass the filepath input as item.tostring
and inside the scope use READ RANGE activity from excel activities and try once

make sure that the FolderPath is with global scope in the variable panel under the scope column and also the type argument of for each loop is String

Cheers @kaavya

2 Likes

can you suggest me now what to do?

Capture7

Fine
now the issue with read range is gone
can i have a view on the merge datatable property panel with a screenshot if possible
Cheers @kaavya

1 Like

Capture5

Fine
may i know the source of TempDT like where it is getting value
and more over why we assign like this
MainDT = TempDT

kindly elaborate the scenario pls
Cheers @kaavya