Excel Process Scope not closing the file

Hi All, I have 2 workflows one is main which excel Process Scope ->use excel file → clear sheet-> write data table to excel activity used to store splunk result in excel next module is app module where it searches splunk results orders using Read range workbook everytime I am receiving error in second workflow stating "Read range workbook: process cannot access the file app.xlsx because it is being used by another process.

How to rectify? Also excel write range also slow takes 5 min how to fix it?

use kill process-Excel before 2nd read range workbook activity.

Try with using excel activities instead of workbook activities

Hello @Sathish_Ashokan ,
Try to use Excel Kill process and delay with 2 seconds. Write range is slow based on the system configuration and data. Try to erite data using write range workbook activity. It may faster than excel activity. But only can write in Xlsx file.

Hi @Sathish_Ashokan

Instead of using write datatable to excel activity use the Write range workbook activity to write the datatable data in to the excel which reduce the time taking to write the data into excel.

Excel Process scope will access the file and the file is using by these activities, after using the excel activities you are using read range workbook in that time bot got fail because that file already in use.

After excel activities give the kill process activity to kill the excel application after that use read range workbook activity.

Hope it helps!!

@Sathish_Ashokan

System.Threading.Tasks.Parallel.Invoke(Sub() System.IO.File.WriteAllText("app.xlsx", ""), Sub() WriteRangeActivity.Write("app.xlsx", DataTable, "Sheet1"))

cheers…!

Have you tried “Kill process” activity
regards,

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