How can I get 3rd party error from Shell?

K

Keith G Hicks

I'm using a 3rd party tool (veryPDF's html2pdf.exe) to create pdf files from
word docs. I'm using a ShellX function (based on Shell) to wait until the
html2pdf.exe is finished before running the code after the shell call. This
all works fine. The problem is that if the html2pdf.exe is unsuccessuful for
any reason (such as if the doc file doesn't exist or the pdf file already
exists) then Shell still returns 0 as if no failure occurred. The
html2pdf.exe does put up its own error message as if you were running it
manually from a DOS window but that doesn't help in my code. I'm sure this
must be a pretty common problem when shelling out to other exe's. What's
the best way to handle this so that I can trap the error and stop the rest
of my code from running.

Thanks,

Keith
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top