IIS7 and “ActiveX component can’t create object” error

3 November 2010 in Blog

I recently ran into an issue running an old ASP application that used a 32-Bit DLL on a Windows 7 64-Bit IIS 7 installation that had me vexed for a while.  The ASP code failed to load the DLL:

Dim oMyObject
Set oMyObject = Server.CreateObject(“My32Bit.MyNewObject.1”)

and reported an error:

ActiveX component can’t create object

I eventually found that 32-Bit application support is disabled by default in IIS7 on 64-Bit, so to resolve the error, here is what I needed to do:

Create a new Application Pool using Internet Information Services (IIS) Manager by clicking “Application Pools” on the left hand pane.  Click “Add Application Pool” and provide it with a name such as “Classic ASP”.  Right click the new application pool and select “Advanced Settings” and under “General” switch “Enable 32-Bit Applications” to “True”.

Then switch your ASP site over to use the new Application Pool by right clicking on the site name and selecting “Manage Application”/”Advanced Settings” and changing the Application Pool to the newly created “Classic ASP”.

Job done.

3 November 2010 Blog