I am encountering a "Invalid Character" error in my VBscript! In particular, within this block of code:
'*******************************************************************
'Import Code
'by Cheyne Wallace
'November 2008
'When using only VBscript (not QTP), this code will import any function library passed into it.
'Copy this function into a file, then use it to bring in various other function libraries.
'Usage:
' Import "Library.vbs"
Sub Import(strFile)
Dim objFSO : Set objFSO = CreateObject("Scripting.FileSystemObject")
Dim wss : Set wss = CreateObject("WScript.Shell")
strFile = wss.ExpandEnvironmentStrings(strFile)
strFile = objFSO.GetAbsolutePathName(strFile)
Set objFile = objFSO.OpenTextFile(strFile, 1)
ExecuteGlobal objFile.ReadAll
objFile.Close : Set objFSO = nothing
Set wss = Nothing
End Sub
The error states "Microsoft VBScript compilation error. Invalid Character. Code: 800A0408
" on Char: 2, Line 206 which is the very first letter on ExecuteGlobal objFile.ReadAll
(character 1 is a tab).
I have typed and retyped the line, as well as the surrounding line breaks. Still, it keeps saying 'Invalid character'. What is going on??