Hi,

This is a problem googled easily, but no solution helped me.

Locally I am trying to open a PowerPoint application to read and import a ppt (or pptx) file.

this is the command where exception is thrown (ASP.NET VB):

objApplication = New Microsoft.Office.Interop.PowerPoint.Application

the exception text is something like:
Retrieving the COM class factory for component with CLSID
{91493441-5A91-11CF-8700-00AA0060263B} failed due to the following error: 80040154.

The solutions I googled are: 1.run dcomcnfg, find Microsoft Powerpoint application, 2. give permissions to ASPNET user.
This could not help, because -->

On a computer, where there was a MS Office 2003 or older installed, and then replaced by new 2007 or 2010 everything works fine. In dcomcnfg i can find "MS Powerpoint slide" (this is the particular object), it has access rights set properly and the application runs great.
I know it is this object, because when I disable it by unchecking "run on local computer", the app throws the same exception as mentioned above.

BUT on a computer with brand new windows XP installation and brand new MS Office 2007 or 2010 installation (without previous Office installed), there is no DCOM object about office powerpoint in dcomcnfg !!!
This must be a MS Office bug, did they forget to include DCOM objects in new installations?

This may be an off topic question. Is there a way to add the needed DCOM object without installing Older Office version?

Hope somebody will help.
Thanks a lot

my first attempt was to somehow record the DCOM object from the windows Registry and try to put it inside the other one.

On a computer, where office 2003 was installed before:
- I made a backup (export) of the whole registry (over 200 MB)
- I did this: Start -> Run... -> dcomcnfg -> found DCOM object "Microsoft Powerpoint Slide - Properties -> in Location tab unchecked everything -> OK
- Then another backup (export) of the registry

I compared the two exports and fount, that a few (13) registry keys changed
e.g. this one:
HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{91493441-5A91-11CF-8700-00AA0060263B}
and its subKeys

I created a .reg script which contained all these registry keys
and ran it on the machine where the error occured (with no previous installation of Office 2003)

WTF, it started working !
but, there is something you must know:
1. the .reg script must determine if:
- if you run a 32-bit or 64-bit system (where the path to powerpoint is ".../Program files (x86)/Office..."
- if you use MS office 2007 or 2010 (the path to powerpoint is "...Office12/powerpoint.exe" or "Office14/...")
2. don't forget to set the DCOM object access rights for ASPNET user.

Lol, once again I solved my own problem.
I hope this helped someone, because I couldn't find help anywhere else.

... wrong.

It doesn't work as it should.

This is really funny. I am not surprised, I was expecting this.
I was surprised, when it seemed to work.

Only copying the Registry keys naturally didn't suffice. There are still some .dll files which are missing.

It worked only, when I ran it from Visual Studio (who knows why).
But when I ran it through IIS (as local website), a new problem appeared: Retrieving the COM ... ... error code 80070002, which means, that some .dll that powerpoint.exe is depending on, is missing.

I used dependency walker to find that there are 3 .dll files missing...
I can try to copy them from somewhere, but I ask:
HOW THE HELL is it possible, that when powerpoint.exe depends on some .dll file, the file is not included in the Office install?


Maybe I am a little lost now.
I go on with investigation.
If anyone can help, your help is welcome here.

Using Open XML SDK is not a good idea.
If I wanted to use it, I would have to
code a lot to be able to import a ppt file
into a webpage with all formats and everything.

I have no time for this.

One thing I tried now is:
- brand new Windows installation (virtual machine)
- Installing MS Office 2003
- running my web application

U know what happened? It worked.
But only when ran from Visual Studio.
After I published the website and ran it through IIS,
the "Retrieving the COM class factory..." error occured again.

By loking into the DCOMcnfg I found no object named "powerpoint slide" or anything similar. So it is not included in Office 2003 installation neither. So where The hell did it come from? Office 97 ? I am not gonna try that.

Question is, why does it work when run from Visual Studio? The .NET 3.5 must have the interop object inside, so I don't need the COM object when running from VS.

I go on with investigation. I hope this monologue will bring its fruit soon.

another step further. I am sure it is an Access privileges issue.
In my solution property pages the page is run with NTLM Authentication,
when I removed this check, it stopped working even in VS.
When NTLMA is on, the app is identified as local user.
IIS Runs as NETWORK Service, so it has "a little" less access, read, write... rights,
just as VS, when NTLMA is off.

Now the problem is to find the COM object the application wants to access and give NETWORK Service rights to access the object.

I tried to do this in the registry to everything with that key {91493441-5A91-...,
I tried it on the whole virtual directory of my webpage in inetpub/wwwroot/,
I have no idea where else should I give permissions... maybe I do something brutal, like give Admin rights to Network service, just to test it.

As usual, I am going on with the investigation. Feel free to interrupt my monologue with something helpful.
Thanks.

I gave up. This is too much.
I am using Aspose.Slides.
It is not free and it is not built to import PPT into HTML,
but it helps.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.