Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / June 2005

Tip: Looking for answers? Try searching our database.

On Error error in Word 97 coce imported into Word 2003

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Geoff Edwards - 14 Jun 2005 11:32 GMT
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:  stopspambot@sixwillow.com
(replace the stopspambot bit with some
version of my name)
Chuck - 14 Jun 2005 18:18 GMT
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.

> I have several templates written in VBa in Word 97.
>
[quoted text clipped - 25 lines]
> (replace the stopspambot bit with some
> version of my name)
Geoff Edwards - 15 Jun 2005 16:42 GMT
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
[quoted text clipped - 38 lines]
>> (replace the stopspambot bit with some
>> version of my name)

Geoff Edwards
Leeds, UK

e-mail:  stopspambot@sixwillow.com
(replace the stopspambot bit with some
version of my name)
Geoff Edwards - 16 Jun 2005 21:09 GMT
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!
>
[quoted text clipped - 57 lines]
>(replace the stopspambot bit with some
>version of my name)

Geoff Edwards
Leeds, UK

e-mail:  stopspambot@sixwillow.com
(replace the stopspambot bit with some
version of my name)
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.