User login

Who's online

There are currently 3 users and 139 guests online.

Advertisements


SourceForge.net Logo

PDFCreator Error 53 - gsdll32.dll not found

Submitted by Jason Moser on Fri, 2007-11-30 08:48.

I was running PDFCreator from Excel using VBA, and it would give me error 53: File Not Found gsdll32.dll.
http://www.imagehosting.com/show.php/1418288_PDFCreatorError53.png.html

After some searching on Google, I discovered that this was a DLL for Ghostscript, which I installed at the same time as PDFCreator. I assumed something had gone wrong, uninstalled and reinstalled - and, hey presto, the same error occurred.

I tested printing to PDF without using VBA - and it worked fine.

I scratched my head for a while, and eventually came up with the following solution:

The problem was that the VBA was shutting the PDFCreator object too fast, before it had completely finished printing. There was a loop (courtesy of ExcelGuru - thanks!) which waited for the CountOfPrintJobs to be 0 - but thereafter, it immediately closed the object. This was apparently just a little too fast for PDFCreator. I added a command to wait for 1 second - and the problem was solved.
I hope this can help somebody else.

'Wait until PDF creator is finished then release the objects
Do Until pdfjob.cCountOfPrintjobs = 0
DoEvents
Loop
'Allow a little extra time to ensure printing has finished
Application.Wait Now + TimeValue("0:0:1")
pdfjob.cClose
Set pdfjob = Nothing

© 2006 by pdfforge.org :: Contact us

Validate XHTML or CSS.