When using the COM interface, MS Excel is not being converted to PDF


I have a problem whereby Excel want convert to PDF. The problem occurs at the point where I use the .PrintFile method.

When I execute .PrintFile, Excel opens without my spreadsheet and just sits there. In order to continue the process at present I have to open the file myself and print using PDF Creator and close excel. At this point the process continues normally.
So far it happens on .xlsx files and .csv files. All other files types I have tested works fine.
I have noticed I don’t have this problem if I use PDF Creator v 2.1.2. It happens on v 3.1.2 though.



sorry for the trouble.
You could potentially work around this by using the native print command of the language you are writing your code in, instead of using the PDFCreator object’s PrintFile method. Unfortunately the shell verbs which control how a file type is printed are now stored in different places in nearly all major Windows version and the lack of proper documentation makes it very hard for us to find a stable way to make the “print” and “open” functions work on all major Windows versions.

Best regards



Hi Robin,
Thanks for your reply. That is a good idea.
I have wrapped PDF creator into a class module so I can build such functionality into the class without affecting the classes interface to other code.

Thanks once again.