Hello,
I have a rather odd problem with MS Access and bullzip. Im converting one by one report (invoice) to PDF with bullzip. The whole process in Access goes without any errors.
However, sometimes I get the error message from the title in bullzip with the next text:
"Error -2147024864: The process cannot access the file 'C:\Users\aaa\AppData\Local\Temp\Bullzip\PDF Printer\Cleaned-20210803.tmp' because it is being used by another process.
Source: mscorlib
Internal hint: Cleanup: Delete temp folders from old sessions (test file date).
Developers: You can hide this message with the "suppreserrors" setting."
When this happens Access continues to work and finishes the procedure but my PDF files get messy.
What happens is that I store the file under the invoice number 0001 as file name but inside the file is actually the invoice 0002.
Below is my code and it works fine as far as I know and it shouldnt mix the invoices. It somehow seems like that bullzip skips one or gets stuck when the error message appears.
I have to mention that this mess up doesnt happen always when the error message appears.
"Internal hint: Cleanup: Delete temp folders from old sessions (test file date)." - should I maybe try to remove the C:\Users\aaa\AppData\Local\Temp\Bullzip\ folder before entering the bullzip export procedure? But if the file is really in use I doubt it will let me remove the folder.
Also, only one user is doing this so thats why its rather strange, no one else is using the export.
I tried to post on bullzips forum but it seems dead, more than 2 weeks and post still not approved.
Thanks in advance. If more info is needed I will add.
I have a rather odd problem with MS Access and bullzip. Im converting one by one report (invoice) to PDF with bullzip. The whole process in Access goes without any errors.
However, sometimes I get the error message from the title in bullzip with the next text:
"Error -2147024864: The process cannot access the file 'C:\Users\aaa\AppData\Local\Temp\Bullzip\PDF Printer\Cleaned-20210803.tmp' because it is being used by another process.
Source: mscorlib
Internal hint: Cleanup: Delete temp folders from old sessions (test file date).
Developers: You can hide this message with the "suppreserrors" setting."
When this happens Access continues to work and finishes the procedure but my PDF files get messy.
What happens is that I store the file under the invoice number 0001 as file name but inside the file is actually the invoice 0002.
Below is my code and it works fine as far as I know and it shouldnt mix the invoices. It somehow seems like that bullzip skips one or gets stuck when the error message appears.
Code:
If Not MyRs.EOF Then
MyRs.MoveFirst
While Not MyRs.EOF
IdPotr = MyRs!IdPotrosaca
FileName = Format(IdPotr, "000000") & "_" & Left(MyRs!TekuciMje, 2) & "_" & Right(MyRs!TekuciMje, 2)
FilePath = "D:\Racuni_PDF\" & Right(MyRs!TekuciMje, 4) & "god\" & FileName & ".pdf"
If IsLoaded("rptRacuniA4") Then
DoCmd.Close acReport, "rptRacuniA4", acSaveYes
End If
DoCmd.OpenReport "rptRacuniA4", acViewPreview, , "IdPotrosaca = " & IdPotr & "", acHidden
If IdPotr <> IdPotrPriExp Then
MsgBox "Some random message", vbCritical, "Title"
Exit Sub
End If
PrintInvoice FilePath
If IdPotr <> IdPotrPriExp Then
MsgBox "Some random message", vbCritical, "Title"
Exit Sub
End If
DoCmd.Close acReport, "rptRacuniA4", acSaveNo
MyRs.MoveNext
Wend
End If
Code:
Sub PrintInvoice(Optional sFileName As String = "", Optional confirmOverwrite As Boolean = False)
Dim oPrinterSettings As Object
Dim oPrinterUtil As Object
Dim sPrintername As String
Dim sFullPrinterName As String
Application.Printer = Application.Printers("Bullzip PDF Printer")
Set oPrinterSettings = CreateObject("Bullzip.PdfSettings")
Set oPrinterUtil = CreateObject("Bullzip.PdfUtil")
sPrintername = oPrinterUtil.DefaultPrintername
oPrinterSettings.Printername = sPrintername
With oPrinterSettings
.SetValue "Output", sFileName
.SetValue "ConfirmOverwrite", "no"
.SetValue "ShowSettings", "never"
.SetValue "ShowPDF", "no"
.WriteSettings True
End With
DoCmd.PrintOut (acPages)
End Sub
I have to mention that this mess up doesnt happen always when the error message appears.
"Internal hint: Cleanup: Delete temp folders from old sessions (test file date)." - should I maybe try to remove the C:\Users\aaa\AppData\Local\Temp\Bullzip\ folder before entering the bullzip export procedure? But if the file is really in use I doubt it will let me remove the folder.
Also, only one user is doing this so thats why its rather strange, no one else is using the export.
I tried to post on bullzips forum but it seems dead, more than 2 weeks and post still not approved.
Thanks in advance. If more info is needed I will add.
Last edited: