Create custom error handling outside of VBA

B

Beeawwb

Hi again,

Is there any way to create error handling that doesn't live inside your
original module? What I'd like to do is be able to add error handling that
lives outside my module, and can be easily updated.

For example, let's say that a new error is given to me by my users. I work
out what the error handling needs to be (e.g. ErrorMsg = MsgBox("Error
number: " & Err.Number & " - Document is locked by password." & vbCrLf &
"Please unprotect manually.", vbCritical, "Error!")) and then I can add this
to my error handling without updating the module itself. I update the
external file (which isn't in use)

I've got another thread open on PrivateProfileString, but I don't think it's
appropriate in this case. While I could use it to get custom error messages
(e.g. ErrorMsg =
System.PrivateProfileString("H:\Errorlist.ini",Err.Number,"Message") I
couldn't actually assign specific handling to the error. (That is, I couldn't
do like a Case statement, whereby it checks Err.Number against the case, and
when a case is found, runs specific code)

Any thoughts?

Thanks again,

Bob
 
J

Jonathan West

Beeawwb said:
Hi again,

Is there any way to create error handling that doesn't live inside your
original module? What I'd like to do is be able to add error handling that
lives outside my module, and can be easily updated.

You can pass the error number to an external routine, but that will still
need to be within your project.
 
B

Beeawwb

Ok, the next thought that occurs to me (and one that probably makes a little
more sense now that I think about it...

The whole purpose of trying to keep things compartmentalised at this stage
is so I can deploy updates while people are still using the original module.

Is it possible to have a "Front End" module, contained in POL.dot, which
would just contain some code to call a routine from another template, say
backend.dot, which would only load backend.dot when it was actually called.
That being, backend.dot would not be loaded at Startup, like POL.dot

This would allow me to make changes to backend.dot, without having to wait
for everybody to go home. I guess it's sort of like an Access front-end /
back-end relationship.

-Bob
 
D

Doug Robbins - Word MVP

See my response to your other post.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 

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