Welcome to Windows Help!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

PowerPoint automation problem

 
   Windows Help (Home) -> Microsoft Powerpoint RSS
Next:  Vista losing internet connection every now and th..  
Author Message
Wolfgang

External


Since: Feb 21, 2010
Posts: 1



(Msg. 1) Posted: Sun Feb 21, 2010 8:29 am
Post subject: PowerPoint automation problem
Archived from groups: microsoft>public>powerpoint (more info?)

Hi there,

I have a problem concerning PowerPoint automation. To illustrate the problem
I wrote a simple test app in c# that looks like this:

using System;
using Microsoft.Office.Core;
using Microsoft.Office.Interop.PowerPoint;

namespace PowerPointTest
{
class Program
{
static void Main(string[] args)
{
if (args.Length == 0)
return;

string presentation = args[0];

ApplicationClass app = new ApplicationClass();
app.Presentations.Open(presentation, MsoTriState.msoCTrue,
MsoTriState.msoFalse, MsoTriState.msoFalse);

Console.WriteLine("Done!");
}
}
}

This application simply opens a presentation if the path to the file is
passed as a parameter.

To test the application, I compile it and copy the exe file to the target
machine, as well as the interop files
(Microsoft.Office.Interop.PowerPoint.dll, office.dll, Microsoft.Vbe.Interop,
stdole.dll) and a test ppt file.

Starting the app on the target machine actually works and I get the "Done"
message on the console, but only if I did a complete installation of Office
2007 on the target machine. If I change the Office 2007 setup to only install
PowerPoint and nothing else, the following exception occurs if I start the
PowerPointTest application:

Unhandled Exception: System.Reflection.TargetInvocationException: Exception
has been thrown by the target of an invocation.
---> System.Runtime.InteropServices.COMException (0x80004005): Unbekannter
Fehler (Exception from HRESULT: 0x80004005 (E_FAIL))
--- End of inner exception stack trace ---
at System.RuntimeType.InvokeDispMethod(String name, BindingFlags
invokeAttr, Object target, Object[] args, Boolean[]byrefModifiers, Int32
culture, String[] namedParameters)
at System.RuntimeType.InvokeMember(String name, BindingFlags
bindingFlags, Binder binder, Object target, Object[] providedArgs,
ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
at System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder
binder, Object target, Object[] args)
at PowerPointTest.Program.Main(String[] args)

The strange thing is that instantiating the ApplicationClass worked, but
calling the Open method didn't.

The exception text is not very helpful, did not find anything useful on the
web.

The exception is reproducable with Office XP, Office 2003 and Office 2007
(but only if I install PowerPoint alone and nothing else).

I get the same exception if I write the test app using late binding. But I
don't think that this is a binding issue, because all needed assemblies
(Microsoft.Office.Interop.PowerPoint.dll, office.dll, Microsoft.Vbe.Interop,
stdole.dll) are registered in the GAC with the correct version 12. I also
tried to install the Office 2007 PIAs on the target machine, but this did not
make any change. So I guess it's not an interop problem.

So my question is, what else has to be installed on the target machine
besides the PowerPoint component?

System configuration:
Windows XP SP2 running in a VMware (could this be the problem?)
..NET Framework 3.5 SP 1

Thanks for ypur help.

Wolfgang

 >> Stay informed about: PowerPoint automation problem 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Problem with Powerpoint Chart with RDP connection - When open PowerPoint 2003, insert a chart, click off (i.e. deselect) the chart, font compresses horizontally and the font are not visible correctly. I used SplitView with RDP.

powerpoint - I have made a 12 month calendar in powerpoint - I only need to save the last slide (december). How can I do that? Thank you.

Powerpoint and P - -- -satrntgr (God bless!!)

powerpoint 2007 - I have a new system that is XP with powerpoint 2007. I have several powerpoint slideshow projects and when I try to play them, I get a message that says there is no associated file to open them and they will not open. I have gone into the folders..

Powerpoint confusion - I'm a new user of Powerpoint 2007 on a Windows XP Pro machine. When I attempt to save a previously named presentation, I get a dialog box that says "Press the ECS key to cancel saving the documment". Under the text is a control labeled CANCE...
   Windows Help (Home) -> Microsoft Powerpoint All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]