Excel: The process cannot access the file, because it is used by another process

datatable
excel
readrange
exception

#1

Hello Folks,

I am doing a simple application where I am reading from an excel, storing in a data table and writing to another excel.

I am getting everything until I write to data table. The moment i access to write to the second excel, i get the error. Should i close the first excel before opening the second one? Could the issue be because of concurrent access (if any)?

Codes attached.

Thanks a lot.
Patch 1.zip (17.0 KB)


#2

Hi @Joshikumarav,
Mistake
Inside excel scope you are using workbook write range activity.
That’s the error.
you need to use corresponding write range activity for excel application scope
excel1
or
Use this activity only for writing
workbook

Regards


#3

Perfect. Thanks, mate.

What I learned was, we don’t need application scope when we have to write an excel. Use the Write Range directly.

Thanks
Joshi


#4

thanks it was helpful