views:

234

answers:

2

I am getting this error while trying to run a VBScript (note this is not in a web environment - just running a VBScript on Windows):

Line: [Last line]
Error: Expected 'End'
Code: 800A03F4
Source: Microsoft VBScript compilation error

I think it is an If statement that is not closed correctly with an "End If," but I've gone through every instance of "If" in the code and cannot find the error. Any tips or tools that could help me figure out where/why this error is occurring?

+2  A: 

In VBScript If is not the only token that requires an End. Also look for Function's and Sub's without their appropriate end statements.

C. Ross
A: 

There was an "Else If" - there should be no space there: "Elseif"

http://www.w3schools.com/VBScript/vbscript_conditionals.asp

Hopefully this will help someone out in the future.

GavinR