Getting Non-negative number error while executing WriteRange

Hi all,
I’m getting this error while executing WriteRange activity.

@PrabhuViswa

Please check the datatypes of columns in Data table.

Regards,
A Manohar

All columns datatype are string.

Please verify the Sheet Name

After creating excel file the sheet name automatically created as"FinalResult" and even I tried by giving the name as"Sheet1" still same error is occured…

@PrabhuViswa

can you explain clearly what you are doing here ?

The issue should be in the DT you are trying to write. What is the value in the Result Datatable you are writing to excel? can you print that and check if it contains values.

because, the filepath or the sheet name if it doesnt exist already also , it will create. These two parameters should not be a problem. Only issue can be with the datatable. @PrabhuViswa

I want to copy some datatable to excel file for the first time it should take header after that it simply append the row next to first row…So, here I use some If condition (File.Exists) then it Append the data Else it Create the file and Write the data with header.

@PrabhuViswa

Are u getting error when creating a new file or when appending ?

Now it solved guys…I simply delete the create file activity because writerange activity itself create a file when it doesn’t exists…But now I have another problem , the same datarow append
one after each even I clear the Datatable before it iterate through another data.