Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

win32::ole PowerPoint Method "SaveAs" Returns Unspecified Error

101 views
Skip to first unread message

TomW7654

unread,
Oct 9, 2012, 3:15:15 PM10/9/12
to
I have a web script that automates PowerPoint 2007 on a Windows XP
pc. It runs via IIS. It's been working well for quite some time.
The pc was just recently "upgraded" to Windows 7 also with Office/
PowerPoint 2007. Now, at this bit of code which is the last step in
the script, "$Presentation->SaveAs($outFile)" PowerPoint throws an
error "Presentation.SaveAs : An error occurred while PowerPoint was
saving the file. Win32::OLE(0.1707) error 0x80004005: "Unspecified
error" in METHOD/PROPERTYGET SaveAs". This only happens when the
script is run via IIS. If I run it from a command line it works
fine. When running via IIS the PowerPoint process runs under my ID.
At first I thought it was some kind of permission problem so I opened
up permissions wide on all related folders but no joy. Any ideas ?
Thanks.

Dirk Krause

unread,
Oct 11, 2012, 10:21:57 AM10/11/12
to
TomW7654 <thomas....@boeing.com> wrote in news:a439344d-51f4-4f30-
a914-17a...@r8g2000pbs.googlegroups.com:

> ... This only happens when the
> script is run via IIS. If I run it from a command line it works
> fine. When running via IIS the PowerPoint process runs under my ID.
> At first I thought it was some kind of permission problem so I opened
> up permissions wide on all related folders but no joy. Any ideas ?
> Thanks.
>

Hello,
As you stated the program worked without problem on Windows XP but
doesn't work on Windows 7.
So it's probably a UAC problem which might be in two places:
(1) Writing to folders specially protected by Windows 7.
Windows 7 protects some folders (and probably user profiles). When
writing to such folders like "\program files" or "\windows" using
Windows explorer the UAC dialog box is shown even if the user has
the required permissions. Non-GUI programs like xcopy or scripts which
do not show the UAC fail to do the write operations.
(2) User context switching from IIS to your account when starting
PowerPoint. Probably Windows 7 wants to show UAC or a confirmation dialog
box for user switching but fails to do so for a service like IIS.

In your situation I'd attempt the following:
(1) Let IIS run PowerPoint as the same user which is running the IIS,
that means do not specify a special user account to run PP.
(2) Create a directory in the root directory of C:, i.e. "C:\testdir".
The owner should be the same account as the account used to run IIS.
If this succeeds you can attempt to place the directory somewhere else.

Unfortunately I'm not an IIS or PowerPoint expert, so this is just what
I have guessed.
Hope this helps.
Regards

Dirk

TomW7654

unread,
Oct 16, 2012, 3:20:58 PM10/16/12
to
On Oct 11, 9:21 am, Dirk Krause <devn...@fh-schmalkalden.de> wrote:
> TomW7654 <thomas.e.we...@boeing.com> wrote in news:a439344d-51f4-4f30-
> a914-17ae29445...@r8g2000pbs.googlegroups.com:
Thank you for your suggestions. They did not solve the problem but
got me to thinking that it had to be some kind of local security that
was preventing the save command from working. I remembered something
about using the DCOM Config tool to force an application to run as a
specific user. Unfortunately PowerPoint did not show up as an
application in DCOM. Then I found a page
http://serverfault.com/questions/94313/powerpoint-missing-from-dcom-config
that explains for a 64 bit system you have to manually add the
Component Services snap it. Low and behold - there was PowerPoint.
After some experimentation I found that using my identity, or
launching user solved the saveas problem but using the interactive
user dud not. I created a local service account and used it to set the
Identify property. Everything now works as it should. Hooray !!!
0 new messages