Results 1 to 3 of 3
  1. #1
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Expected Expression (Word 2000)

    FYI.

    (See also <post:=166,435>post 166,435</post:>)
    I got this compile error, at run time, but not at compile time (Debug, Compile) on what I figured was the simplest of all macros, and a recorded one, to boot:<pre>Sub Name()
    '
    ' Name Macro
    ' Macro recorded 11/3/2008 by CGreaves
    '
    Selection.TypeText Text:="Chris Greaves"
    End Sub</pre>

    I now figure that VBE is objecting to the use of a reserved word "Name".
    (I mean, there are novice errors, then there are novice errors!!)

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

    Re: Expected Expression (Word 2000)

    It's somewhat nebulous (to me) what VBA will accept

    Sub Int() is rejected when you press Enter, as is Sub Open().
    Sub Name() is accepted by a syntax check but causes a runtime error.
    Sub Dir() will happily run, as will Sub Chr().

  3. #3
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Expected Expression (Word 2000)

    >It's somewhat nebulous (to me)
    So what hope do the rest of us have?

    >Sub Name() is accepted by a syntax check but causes a runtime error.
    Let's debate this at length (grin!).
    It causes a compile error at run-time, which just muddies the water awfully well!

    Anyway, here it is, for you all. This thread can sit here until it gets picked up in a search.

Posting Permissions

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