We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

The process cannot access the file

Hii,

Please help me in solving this problem.

I am generating multiple appointment letters at once in one page.

But sometimes i am getting the follwoing error messege..

The process cannot access the file "D:\MailCom\letters\GeneratedLetters\ApplicantOfferLetter(1-20).pdf" because it is being used by another process.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.IO.IOException: The process cannot access the file "D:\MainCom\letters\GeneratedLetters\ApplicantOfferLetter(1-20).pdf" because it is being used by another process.

Source Error:

Line 1268:                pdf.BindXML(MyPathNew & "ApplicantOfferLetter(" & intFromAppID & "-" & intToAppID & ").xml", Nothing)
Line 1269:                pdf.IsImagesInXmlDeleteNeeded = True
Line 1270:                pdf.Save(MyPathNew & "ApplicantOfferLetter(" & intFromAppID & "-" & intToAppID & ").pdf")
Line 1271:
Line 1272:                strvar = ConfigurationSettings.AppSettings.Get("ServerIPHSL")

Source File: D:\MainCom\StartUp\RequisitionRecruitment\Forms\JobOfferBase.aspx.vb Line: 1270

Stack Trace:

[IOException: The process cannot access the file "D:\BajajAllianz\letters\GeneratedLetters\ApplicantOfferLetter(1-20).pdf" because it is being used by another process.]
   System.IO.__Error.WinIOError(Int32 errorCode, String str) +614
   System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean useAsync, String msgPath, Boolean bFromProxy) +888
   System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share) +45
   System.IO.File.Open(String path, FileMode mode) +44
   Aspose.Pdf.Document.ุ.฽(String ฼) +56
   Aspose.Pdf.Xml.ᖻ.ᗀ(ጊ ጁ, Pdf ᗁ) +137
   Aspose.Pdf.Pdf.Save(String pdfFile) +435
   RequisitionRecruitment.JobOfferBase.ExecuteApplicantDetailsDataTable(Int32 intAppid) in D:\BajajAllianz\StartUp\RequisitionRecruitment\Forms\JobOfferBase.aspx.vb:1270
   RequisitionRecruitment.JobOfferBase.PrintFunc(String intAppID) in D:\BajajAllianz\StartUp\RequisitionRecruitment\Forms\JobOfferBase.aspx.vb:1130
   RequisitionRecruitment.JobOfferBase.btnOLO_Click(Object sender, EventArgs e) in D:\BajajAllianz\StartUp\RequisitionRecruitment\Forms\JobOfferBase.aspx.vb:1089
   System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
   System.Web.UI.Page.ProcessRequestMain() +1277


Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.573

Thanks,

Hi

Thanks for your inquiry. This means that file you are trying to write is used by another program. For example it is opened in Acrobat Reader. This error is not related to Aspose.Words.

You should just make sure that file is not used by another program.

Best regards.