Code Error 800A01A8 – Object Required

Troubleshooting Code 800A01A8 – Object Required

Error 800A01A8 is medium-difficult error to solve.  The secret of success is knowing where to expect a VBScript method.  Another cause is inconsistent use of script variables.

  ‡

Introduction to Error Code 800A01A8

This error code, 800A01A8 usually occurs when you execute a VBScript.  My suggestion is that there is a typo in an object or method in your script.

The Symptoms You Get Code 800A01A8 - Object required

The script does not execute as you hoped, instead you get a WSH error message.  One possibility is that you are using a WSH object does not exist or has not been declared.

The Cause of Error 800A01A8

Your VBScript contains an illegal method, probably a typing mistake or an extra letter.  Check the logic of your METHOD statement. Note Source: Microsoft VBScript runtime error.

The Solutions to Object Required

Look for clues particularly the Line: number and check the Char: references.  In the example it is Line 4.  Char : 1. In this case it is not Char 1 to blame, more that there is something wrong and none of the line can execute.  Once you have located the line, pay close attention to the spelling of your objects and methods.  Research a similar method in another script.

Alternatively, try adding Option Explicit to the beginning of your VBScript.  My idea is to discover if you have mistyped the name of a variable.

Incidentally, in the WSH message, Source: reports a runtime error not a compilation error, this means you are not looking for a pure syntax problem such as a missing bracket.  The most likely cause is a typo which induces faulty logic.

In the case of runtime errors, you can use this temporary work around.  Add this statement just before the line which errors: On Error Resume Next.

Example 1 of Error 800A01A8

The problem here is a mix up with the singular ‘net’ and the plural ‘nets’.  As we declared nets we should be consistent and in line 3 say:
Set nets (not Set net).

A typo turns into a logical error because nets has not been created, therefore we cannot use it to add a printer.  Incidentally, this is a classic case for always using either singular or plural variables.

‘ VBScript 800A01A8 Error code – Object required
Dim nets
Set net = CreateObject("WScript.Network")
nets.AddWindowsPrinterConnection "\\lucy4\dotty", "Dot Matrix"

Guy Recommends:  A Free Trial of the Network Performance Monitor (NPM)Review of Orion NPM v11.5 v11.5

SolarWinds’ Orion performance monitor will help you discover what’s happening on your network.  This utility will also guide you through troubleshooting; the dashboard will indicate whether the root cause is a broken link, faulty equipment or resource overload.

What I like best is the way NPM suggests solutions to network problems.  Its also has the ability to monitor the health of individual VMware virtual machines.  If you are interested in troubleshooting, and creating network maps, then I recommend that you try NPM now.

Download a free trial of Solarwinds’ Network Performance Monitor

Example 2 of Error 800A01A8 VBScriptWSH error message Error 800A01A8

This is an example where a vital command or object is completely missing.

As is so often the case, the line number is of great help with code 800xxxxx errors.  Here on Line 19 is the error: Set objUser = (strPath).  In this instance, ‘[string: "LDAP://cn=elizabeth,"]’ tells only part of the story.  There is a problem with cn=elizabeth, but its a missing command GetObject. 

What is missing is GetObject

It should be :Set objUser = GetObject(strPath)

‘ Bind.vbs  Code Error 800A01A8 – Object required
‘ Stage 1) Binds to Active Directory
‘ Version 1.2
‘ Guy Thomas 18th July 2010

‘ Commands to bind to AD and extract domain name
Set objRootDSE = GetObject("LDAP://RootDSE")
strDNSDomain = objRootDSE.Get("DefaultNamingContext")
WScript.Echo "Active Directory Path: " & strDNSDomain
‘ Edit the next line to reflect your OU
strOU ="cn=elizabeth,OU=Worcester,"
strUser ="cn=elizabeth"

‘ Building the LDAP path
strPath ="LDAP://"& strOU & strDNSDomain

Set objUser = (strPath)
Wscript.Echo "DN "& objUser.get("distinguishedName")

WSCript.Quit

‘ End of Example error 800A01A8 Script

I solved this problem using the parallel script technique, finding a similar script that worked and then comparing the statements.

 

See More Windows Update Error Codes 8004 Series

Error 800A101A8 Object Required   •Error 800A0046   •Error 800A10AD   •Error 800A000D

Error 80048820   •Error 800A0401   •Review of SolarWinds Permissions Monitor

Error 80040E14   • Error 800A03EA   • Error 800A0408   • Error 800A03EE

Solarwinds Free WMI MonitorGuy Recommends: WMI Monitor and It’s Free!

Windows Management Instrumentation (WMI) is one of the hidden treasures of Microsoft operating systems.  Fortunately, SolarWinds have created the WMI Monitor so that you can examine these gems of performance information for free.  Take the guess work out of which WMI counters to use for applications like Microsoft Active Directory, SQL or Exchange Server.

Download your free copy of WMI Monitor


Do you need additional help?

Give something back?

Would you like to help others?  If you have a good example of this error, then please email me, I will publish it with a credit to you:

 

If you like this page then please share it with your friends