Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9019767
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T04:51:23+00:00 2026-06-16T04:51:23+00:00

I am encountering a Invalid Character error in my VBscript! In particular, within this

  • 0

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??

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T04:51:24+00:00Added an answer on June 16, 2026 at 4:51 am

    As it turns out, the problem was not with ExecuteGlobal, but instead with the .vbs file I was attempting to import. The file I was importing was not in ANSI encoding. If VBScript has a problem with the file you are importing, it will report the error at the character and line for the beginning of ExecuteGlobal (which admittedly causes confusion).

    Open the file you are attempting to import, convert it to ANSI and everything should work.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am randomly encountering the following error: Message: Invalid viewstate. Client IP: xx.xxx.xxx.xx Port:
I am encountering this error whenever the button is clicked to collapse/expand the panel.
I'm encountering this error : Membership credential verification failed. when I try to login
I'm encountering an error sprintf statement. I added a printf command to help investigate,
I am encountering a very strange error with my project. I normally use the
I've been encountering an OverflowException recently within GDI+ via a 3rd party tool which
Hello I would need some help with the following code and memory leak. Error
I´m encountering this problem trying to mock some objects that receive complex lambda expressions
I am encountering cursor index out of bounds exception. My code is as follows.
This is my code for a simple arrow sequencing application. It generates a random

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.