Bryan Davies
Bryan Davies

Reputation: 430

Error Handling with Excel VBA controlling Word and PDF

TL DR version: what errors should I specifically look for in a error handler with an excel vba running a word template and saving as word doco and pdf.

For the first time, I am actually giving a macro spreadsheet to someone excel literate, but macro illiterate.

This spreadsheet basically opens a bunch of word templates, changes some bookmarks, saves as a word document and as a PDF.

I cannot afford for this spreadsheet to fail, which brings me to error handling.

I haven't really pushed into error handling too much previously. But I have come up with a list of possible errors the 3rd party could run into

Invalid Inputs (various)
Cannot find word templates
Cannot find bookmarks
Cannot Save As Word (various reasons)
Cannot Save As PDF (various reasons)
Not having Microsoft Word 16.0 object library

Is there any other errors I should be catching?

how do I deal with the Not having Microsoft Word 16.0 object library?

Upvotes: 0

Views: 307

Answers (1)

rohrl77
rohrl77

Reputation: 3337

Sorry to be writing this - I know it's not the answer your looking for, but my experience has been that it is not possible to create an exhaustive list of errors that might occur... especially user errors.

Nevertheless... here are some more to add to your list:

  • Check if template or other source document is already opened by someone else
  • Check if directory exists (if different to the one being pulled from)
  • Try to lock down as much as possible for user... let them only access that which they absolutely need to

Upvotes: 1

Related Questions