The process cannot access because it is being used by another process error in net(Aspose.cells Ver.22)

Any Solution for this problem?

@edwinponnappan,

Please elaborate your issue and provide more details on your issue. Also, please share your sample files and code (with steps details) to reproduce the issue on our end. We will check your issue soon.

PS. please zip the file(s) prior attaching here.

Hi Im monitoring the input folder and when some files are created in that folder the file should be converted to PDF.when i upload multiple file on input folder first uploaded file is getting converted properly.second file is throwing error.

In for loop i have the following code.i added dispose() after issue raise

workbook.Save(_output_path + “/” + Path.GetFileNameWithoutExtension(fileName) + “.pdf”, Aspose.Cells.SaveFormat.Pdf);
workbook.Dispose();

@edwinponnappan
Please share your template file and sample codes herr, we will check it soon.

aspose.7z (3.9 KB)

currently im using aspose for excel conversion only.please find the above code

@edwinponnappan
Please attach your tempalte files.

testdoc.7z (9.2 MB)

@edwinponnappan

It seems that when file creation is watched, the file copying/uploading is still in process. You need to wait for some time before starting a new ProcessDirectory(). e.g. waiting for 1 second: System.Threading.Thread.Sleep(1000);

Code:

private static void OnCreated(object sender, FileSystemEventArgs e)
{
    //string value = $"Created: {e.FullPath}";
    //Console.WriteLine(value);\
    
    //Sleep some time to wait for the process of copying/uploading files is done
    System.Threading.Thread.Sleep(1000);
    ProcessDirectory();
}

result.7z (180.1 KB)
Thank you for your response…i will check.also i have some issues on conversion result…could you check and give some solution

page is not displayed properly…could you check templates?testdoc.7z (9.2 MB)

@edwinponnappan,

Thanks for the sample files.

I evaluated your issue using one of your template file “#40168(2021)_検査報告書(目視).xlsx” to directly convert to PDF via Aspose.Cells APIs. In the output PDF file, I only noticed issue on the second page, the contents/data is actually part of first page which should be rendered on the first page. Could you confirm this is the only issue you are talking about? After your confirmation, I will log a separate ticket for the issue into our database.
e.g.
Sample code:

    Workbook workbook = new Workbook("e:\\test2\\#40168(2021)_検査報告書(目視).xlsx");
    workbook.Save("e:\\test2\\out1.pdf");

exactly that was the problem…could you log a seperate ticket for the issue?

@edwinponnappan,

Thanks for the confirmation.

I have logged a separate ticket with an id “CELLSNET-50554” for your issue. We will look into it soon.
Once we have an update on it, we will let you know here.

@edwinponnappan,

This is to inform you that your issue has been resolved. The fix will be included in our regular (upcoming) release: Aspose.Cells for .NET v22.3. You will also be notified in this thread when the next version is released.

The issues you have found earlier (filed as CELLSNET-50554) have been fixed in this update. This message was posted using Bugs notification tool by johnson.shi