Consulting

Results 1 to 2 of 2

Thread: Macros stop working after I restart Outlook. Why?!?

  1. #1
    VBAX Regular
    Joined
    Apr 2007
    Location
    Sector ZZ 9 Plural Z Alpha
    Posts
    6
    Location

    Macros stop working after I restart Outlook. Why?!?

    I created a little VBscript to run a macro in Outlook 2000 (I'm stuck using this version).
    The marco works every time I run it... while Outlook is open.

    e.g.
    In Outlook:
    Sub helloworld()
     MsgBox "Hello world"
    End Sub
    In c:\dev\helloworld.vbs:
    dim outlookRef
    Set outlookRef = CreateObject("OUTLOOK.APPLICATION")
    outlookRef.helloworld
    Set outlookRef = nothing
    If I run helloworld.vbs I get the expected alert box. If I close, then reopen Outlook I get the error:
    ---------------------------
    Windows Script Host
    ---------------------------
    Script:    C:\dev\helloworld.vbs
    Line:    3
    Char:    1
    Error:    Object doesn't support this property or method: 'helloworld'
    Code:    800A01B6
    Source:     Microsoft VBScript runtime error
    --------------------
    The macro still exists and it still works if I run it from inside Outlook. But helloworld.vbs never works again.

    I have to delete c:\Documents and settings\sukotto\Application Data\Microsoft\Outlook\VBAProject.otm, reboot my machine, and recreate the macro. After doing that helloworld.vbs works... it works until I close Outlook again.

    My google-fu has failed me (the only solutions I've found for this issue are "delete the project file and recreate the macro").

    Anyone know why I have this problem and how to permamently fix it?


    This is in Outlook 2000 running on Win2k SP4


  2. #2
    VBAX Regular
    Joined
    Apr 2007
    Location
    Sector ZZ 9 Plural Z Alpha
    Posts
    6
    Location
    In the end I just gave up. :-(
    Instead, I pushed all my code out to the vbscript file.

Posting Permissions

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