On Error error in Word 97 coce imported into Word 2003

G

Geoff Edwards

I have several templates written in VBa in Word 97.

All imported successfully into Word XP.

At a few points, I use this:

On Error Resume Next
<potential error line>
On Error GoTo 0

Although I cannot find anything in any of the templates to account for
it, most of the templates have imported into Word 2003 successfully
but in one (and only one) where I have used the above, VBa reports an
error at <potential error line>

Obviously, the On Error Resume Next isn't working.

Anyone any idea why?

TIA

Geoff

Geoff Edwards
Leeds, UK

e-mail: (e-mail address removed)
(replace the stopspambot bit with some
version of my name)
 
C

Chuck

From the limited example you supplied it doesn't look like you have any error
handling code after your Resume Next (except for disabling error handling
with GoTo 0). So your code looks like it's trying to deal with errors by
ignoring them.

Have you considered devising code that resolves the error condition instead
of trying to skip past it? Sounds like XP isn't going to let you get away
with things that 97 was more forgiving about. You might want to use a
message box displaying Err.Num and Err.Description to get more information
about what the error is so you can resolve it.

Then again, I wouldn't be surprised if I'm missing something.
 
G

Geoff Edwards

Sorry if I wasn't specific enough!

There are other placers where do I pick up the error code and then act
on it, or would if the damned program would process it correctly.

As I said, all my On Error ... statements worked in 97 and 200 and XP
- it is in Word 2003 that they seem to be being ignored.

This is driving me up the wall.

Geoff



From the limited example you supplied it doesn't look like you have any error
handling code after your Resume Next (except for disabling error handling
with GoTo 0). So your code looks like it's trying to deal with errors by
ignoring them.

Have you considered devising code that resolves the error condition instead
of trying to skip past it? Sounds like XP isn't going to let you get away
with things that 97 was more forgiving about. You might want to use a
message box displaying Err.Num and Err.Description to get more information
about what the error is so you can resolve it.

Then again, I wouldn't be surprised if I'm missing something.

Geoff Edwards
Leeds, UK

e-mail: (e-mail address removed)
(replace the stopspambot bit with some
version of my name)
 
G

Geoff Edwards

Oh I do feel stupid now.

In ALL versions of Vba there is a setting under Tools|Options|General
to opt to "Break on all errors" or "Break on unhandled errors".

I thought it was just a setting for design time testing - I didn’t
realise that "Break on all errors" would be saved as part of the
template.

Although you would never guess it from the name of the setting, it
causes Vba to break on all errors.

I apologise for having wasted your time.

Geoff


Sorry if I wasn't specific enough!

There are other placers where do I pick up the error code and then act
on it, or would if the damned program would process it correctly.

As I said, all my On Error ... statements worked in 97 and 200 and XP
- it is in Word 2003 that they seem to be being ignored.

This is driving me up the wall.

Geoff





Geoff Edwards
Leeds, UK

e-mail: (e-mail address removed)
(replace the stopspambot bit with some
version of my name)

Geoff Edwards
Leeds, UK

e-mail: (e-mail address removed)
(replace the stopspambot bit with some
version of my name)
 

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