1,105,456 Community Members

Interop.PowerPoint.Application not working

Member Avatar
xzajox
Newbie Poster
11 posts since Nov 2008
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

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

Member Avatar
xzajox
Newbie Poster
11 posts since Nov 2008
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

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.

Member Avatar
xzajox
Newbie Poster
11 posts since Nov 2008
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

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

Member Avatar
xzajox
Newbie Poster
11 posts since Nov 2008
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

I think this path was not for me, it is getting over my head.

At the moment I found an article which says, that MS doesn't recommend using Office automation server-side, that means my web application too.
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q257757#kb2
They offer an alternative - using
Open XML SDK

I will give it a try.

Member Avatar
xzajox
Newbie Poster
11 posts since Nov 2008
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

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.

Member Avatar
xzajox
Newbie Poster
11 posts since Nov 2008
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

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.

Member Avatar
xzajox
Newbie Poster
11 posts since Nov 2008
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

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.

Question Self-Answered as of 3 Years Ago
kemaltaskin
Newbie Poster
1 post since Jul 2012
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
Unverified Member
 
0
 

The solution in http://social.msdn.microsoft.com/Forums/en/wcf/thread/86c5d935-aeff-4b54-aa68-882d2e5d6b78 worked for me. I also did the aforementioned security settings in dcomcnfg in addition to this.

It is sad that Microsoft do not offer a decent solution to this problem still.

You
This question has already been solved: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: