×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

CATScriptError

CATScriptError

CATScriptError

(OP)
Microsoft VBScript complilation error
Description: Expected end of statement
Statement: Dim ProductDoc1 As Document

Here is the macro:
Sub CATMain()
Dim ProductDoc1 As Document
End Sub

Any help would be great!
Thanks,
Jim

RE: CATScriptError

VBScript is a late-bound language, you cannot dim as type. Comment out or remove "as document".

RE: CATScriptError

(OP)
Really? No declaring of variables?
Not sure about "late-bound" means.
So I can not use macros that declare variables?
Thank You
Jim K

RE: CATScriptError

You can but you have to comment out "as type". You also cannot use GoTo, other than "on error GoTo net" and "on error GoTo 0". There is also no collection class, so you cannot create your own collections. Late-bound means the compiler discovers variable type on-the-fly, early bound know them ahead of time...see http://v5vb.wordpress.com/2010/07/29/restricted-in.... Remember VBScript is a simplified version of VBA.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources