Results 1 to 3 of 3
  1. #1
    Lounger
    Join Date
    Oct 2001
    Location
    New York, New York, USA
    Posts
    41
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Macro error is making me crazy!! (VBA/Word 97&2000)

    This problem is making me crazy. We are upgrading from Office 97 to Office 2000. There are a few problems, but most can be solved. But this one is making me crazy. On a few documents, we get an Runtime error 4608 Value out of range on this line of code:

    ActiveDocument.PageSetup.FooterDistance = InchesToPoints(0.3)

    I can't see anything different about the documents that fail. The page setup, the margins, the paper size, fonts, footers, you name it, all appear to me to be exactly the same. If I precede the line of code above with

    On Error Resume Next

    the program will continue (obviously), but it sometimes adds the footer information a second time instead of replacing it.

    My question: does anyone have any idea what could be different about Word 2000 that would cause some documents (fewer than 1%) to have a runtime error on this line of code?

    By the way, this group has been by far the most informative and helpful I've ever found. I try to keep up with all the posts (when my job will allow), but I might have missed something on this topic. At any rate, thanks for all the help in the past, and I hope someone has an idea what (else) I could try to fix this one.

    Regards,
    Michael Dagley

  2. #2
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Macro error is making me crazy!! (VBA/Word 97&2000)

    One thing comes to mind.

    The documents in question contain some heretofore unseen corruption. Maybe they were converted from WordPerfect or whatever. Try this because you haven't got anything better to do today, right?

    Open one of the "bad" documents. Select all the text except the final paragraph mark; copy to clipboard. Paste the contents to a new blank document and save. Run your code against this new document. Still a problem?

    However, I don't understand this statement from your post:

    >>the program will continue (obviously), but it sometimes adds the footer information a second time instead of replacing it.

    Huh? Activedocument.pagesetup.footerdistance sets one setting per section in a Word document. See below. How can that be "added a second time"?
    Attached Images Attached Images
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  3. #3
    Lounger
    Join Date
    Oct 2001
    Location
    New York, New York, USA
    Posts
    41
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Macro error is making me crazy!! (VBA/Word 97&2000)

    Thanks for the suggestion. I thought you'd found the answer (document corruption), and it worked for a couple of documents, but not for most. Also, forgive me for mentioning the "adds rather than replaces" footer line. You're right that it should put the footer in a certain place. The macros I inherited are very complex, and the one that should delete all items in the footer formatted with marching red ants doesn't work for the same documents that have the runtime error. My apologies for being so obtuse.

    I'll continue trying to find an answer for this, and I'll let you know if [when] I do. Thanks very much for your help.

    Michael Dagley

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •