Welcome to MSDN Blogs Sign in | Join | Help

ActiveX component can't create object, when creating a 32-COM object in a 64-bit machine

I had two posts to resolve an issue with applications that use a 32-bit COM object in a 64-bit OS. Workaround for executable, and ASP.Net.

I recently helped someone who had the same problem, but with a VB Script application, executed with cscript.exe. This VB script application uses a 32-bit COM object and failed to run on a 64-bit OS. The error, Microsoft VBScript runtime error: ActiveX component can't create object: 'XXXXXX'.

To fix the issue, the script must be executed with the right executable. There are two cscript.exe in the 64-bit OSes. One is located at %WINDOWS%\System32, and the second one is located at %WINDOWS%\SysWOW64.

The one under System32, is a 64-bit version. The one under SysWOW64 is the 32-bit version. Run the VBS application using the 32-bit application.

Why System32 contains 64-bit binaries, and SysWOW64 contains 32-bit is another story, but there is a very good reason behind it, backward compatibility. :)

Published Wednesday, December 12, 2007 7:26 AM by HelloWorld

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# re: ActiveX component can't create object, when creating a 32-COM object in a 64-bit machine

Nice one, thanks -- had us stumped for a bit.  I guess "System32" was an unfortunate choice of names.  --Brett

Friday, November 14, 2008 11:42 AM by Brett

# re: ActiveX component can't create object, when creating a 32-COM object in a 64-bit machine

> Why System32 contains 64-bit binaries, and SysWOW64 contains 32-bit is another story, but there is a very good reason behind it, backward compatibility. :)

Seems consistent with Microsoft's other conventions, like selecting "Start" to shutdown your computer.

Wednesday, April 01, 2009 4:20 PM by Lonnie

# re: ActiveX component can't create object, when creating a 32-COM object in a 64-bit machine

@Lonnie

You turned the ignition key to shut off you car. :)

It was based on usability.

http://blogs.msdn.com/oldnewthing/archive/2003/07/22/54559.aspx

Thursday, April 02, 2009 5:15 PM by HelloWorld

# re: ActiveX component can't create object, when creating a 32-COM object in a 64-bit machine

Thanks for the info. I have an additional question. If you run the script from a 32-bit 2003 server and it has to interact with a DC that is on a 2008 server what do you need to do to get it to work then?

Friday, June 05, 2009 7:33 AM by Joacim

# re: ActiveX component can't create object, when creating a 32-COM object in a 64-bit machine

@Joacim:

I am not sure, but I think that should be fine.

Friday, June 05, 2009 12:59 PM by HelloWorld

# re: ActiveX component can't create object, when creating a 32-COM object in a 64-bit machine

Well it doesn't for some reason. I guess you somehow have to point it to the %WINDOWS%\SysWOW64 catalogue in the script. I assume that %WINDOWS%\System32 would be default on the 2008 64-bit machine, or should it be able to identify that automatically?

Monday, June 08, 2009 3:06 AM by Joacim

# re: ActiveX component can't create object, when creating a 32-COM object in a 64-bit machine

@Joacim:

You have to point to %WINDOWS%\SysWOW64. That folder contains 32-bit images. %WINDOWS%\System32 contains 64-bit images, and it is the default.

Tuesday, June 30, 2009 3:47 PM by HelloWorld

# re: ActiveX component can't create object, when creating a 32-COM object in a 64-bit machine

I had a similar situation when trying to run a SQL Server job that executes a WSH VBScript task that uses a small in-house com object (also VBScript) after upgrading our DB Server machine to Windows 2008 x64, but still running 32 bit SQL Server 2005.

When I tested the script from a command window it worked fine, but the SQL Server job executing the same script kept failing with the 'ActiveX component can't create object' message.

What worked for me was to also register the the com object using the 32 bit version of regsrv32.exe in the syswow64 dir!

Seems like running WSH directly uses the 64 bit environment and so it found the normal com object registration OK, but 32 bit SQL Server 2005 could only see 32 bit com object registrations.

I hope this helps others battling with this situation.

Thursday, October 01, 2009 8:02 AM by ShaunM

Leave a Comment

(required) 
required 
(required) 

  
Enter Code Here: Required
 
Page view tracker