Results 1 to 8 of 8
  1. #1
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Morden, Surrey, United Kingdom
    Posts
    1,838
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Macro fail (WinNT4, Word97)

    On the attached document, a cut down copy of one of a number of documents I am setting up (with major help by fellow loungers, for which many thanks!) by which people can look at a master copy of a template by clicking on one button or run the template with another, I have errorhandling built in so that if the network connections are not set up correctly the error handler brings up a message saying to call the helpdesk. On the first macro, RunTemplate, this works fine; but on the second, ViewMaster, if it can't find the document it insists on bringing up the VBE and the standard 'doc could not be found. Try this ...' error message - which as you know, simply frightens the life out of your average user!

    I really can't see what is going wrong; can anyone help me, please? <img src=/S/grovel.gif border=0 alt=grovel width=31 height=23>
    Attached Files Attached Files
    Beryl M


  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Macro fail (WinNT4, Word97)

    I get the "Sorry, something is preventing ..." message for both buttons (Word 97 SR2, WinNT4). <img src=/S/confused.gif border=0 alt=confused width=15 height=20>

  3. #3
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: Macro fail (WinNT4, Word97)

    The document behaves as expected for me on Word 2000 SR1a, double clicking on any of your controls leads to the appropriate error message!

    StuartR

  4. #4
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Morden, Surrey, United Kingdom
    Posts
    1,838
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Re: Macro fail (WinNT4, Word97)

    Aaagh! Maybe I'll have to get some users to test it and see if it's just me ...

    Trouble is, I hate leaving anything like that because if it does it to me, I can never be 100% certain it's not going to do it to someone else! Mutter <img src=/w3timages/censored.gif alt=censored border=0> mutter <img src=/w3timages/censored.gif alt=censored border=0> mutter ...

    Thanks anyway!
    Beryl M


  5. #5
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Morden, Surrey, United Kingdom
    Posts
    1,838
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Re: Macro fail (WinNT4, Word97)

    <img src=/S/scream.gif border=0 alt=scream width=15 height=15> <img src=/S/bwaaah.gif border=0 alt=bwaaah width=123 height=15> <img src=/S/hairout.gif border=0 alt=hairout width=31 height=23>

    Aaaargh! This is driving me mad! You know the document I attached to my post at the top of this thread? Well, I have continued working on these docs which, as you can imagine, are identical except for the templates names and descriptions themselves.

    The one I was working on, I closed last night (working fine) and when I opened it this morning the RunTemplate macro doesn't work. It doesn't fall over, give an error message, crash or anything else to show it's alive - it just doesn't do anything. I could be double-clicking on an ordinary bit of text in a document for all the reaction I get.

    If I copy the entire text and use it to replace the text of another of the list documents (code is all identical) the macro works. Copy it back and it doesn't.

    <img src=/S/grovel.gif border=0 alt=grovel width=31 height=23> Someone PLEASE tell me what I'm doing wrong! <img src=/S/weep.gif border=0 alt=weep width=21 height=16>
    Beryl M


  6. #6
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Morden, Surrey, United Kingdom
    Posts
    1,838
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Re: Macro fail (WinNT4, Word97)

    Well, I've found a way to fix them - move the entire code to a module and point the macrobuttons to that module. Why that works, I don't know; but what I want to know is, is it going to keep working or will this just stop some day like the thisdocument version did?

    If anyone can shed any light as to why this is happening, I'd be grateful - I hate having something like this happen and not being able to find out WHY!

    If it's a bug, fine, as long as I KNOW it's a bug and can find code that will work around it; or if it's my fault, once I know what I'm doing wrong I can try to sort it - but I hate this not knowing!

    I hope someone can help!
    Beryl M


  7. #7
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: Macro fail (WinNT4, Word97)

    Beryl,
    As a general rule, standard subs and functions should be kept in normal modules rather than class modules (which ThisDocument is, after a fashion). Otherwise, their behaviour is, as you have found, a little erratic. I'm not sure of the technical explanation for this (hopefully someone can enlighten us both!) but I have often noticed it in Excel.
    Hope that helps.
    Regards,
    Rory

    Microsoft MVP - Excel

  8. #8
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Morden, Surrey, United Kingdom
    Posts
    1,838
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Re: Macro fail (WinNT4, Word97)

    Well, at least it's nice to know someone else's experience has run on similar lines!

    As you say, hopefully someone will tell us why this happens!

    Thanks, Rory <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>
    Beryl M


Posting Permissions

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