Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations SSS148 on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

CATScriptError

Status
Not open for further replies.

kuleszajmk

Automotive
Nov 7, 2010
29
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
 
Replies continue below

Recommended for you

VBScript is a late-bound language, you cannot dim as type. Comment out or remove "as document".
 
Really? No declaring of variables?
Not sure about "late-bound" means.
So I can not use macros that declare variables?
Thank You
Jim K
 
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 Remember VBScript is a simplified version of VBA.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor