Hello!
I am using late binding to start PowerPoint. I have two versions of
it: PowerPoint 2003 on my development PC and 2007 at the client.
Starting PowerPoint works on both machines, but I can't run a
presentation on the other computer.
I get a COMException, when I start it:
Exception in PowerPointViewer.Start():
System.Runtime.InteropServices.COMException (0x80004005): Unspecified
error
at
Microsoft.VisualBasic.CompilerServices.LateBinding.LateGet(Object o,
Type objType, String name, Object[] args, String[] paramnames,
Boolean[] CopyBack)
at PowerPointViewer.Start()
I already looked at http://support.microsoft.com/kb/814912/en-us, but
it doesn't soll my problem.
<code>
Class PowerPointViewer
Private Shared powerpointApp As Object = Nothing
Private presentation As Object
Private filePath as String
Public Sub New(ByVal _filePath As String)
filePath = _filePath
End Sub
Sub Start()
If IsNothing(powerpointApp) Then
Log("Start PowerPoint ")
powerpointApp = CreateObject("PowerPoint.Application")
End If
Log("Open PowerPoint Presentation" & filePath)
' HERE: The COMException happens when calling Open
presentation = powerpointApp.Presentations.Open(filePath, , ,
False)
' this doesn't work, too
'presentation = powerpointApp.Presentations.Open(filePath, False,
False, False)
' some code ommited
presentation.Run()
End Sub
End Class
</code>
I am using .Net 1.1.4332 and Visual Studio 2003
Alan Gillott - 29 Feb 2008 20:58 GMT
That doesn't look right: Powerpoint programming is a minority activity but
if the object model is consistent with Word and Excel, you will need to add
an object to the presentations collection first.
Why not use GetObject? You will open the presentation directly. it will look
something like this
presentation = GetObject("file path","Powerpoint.Application")
Presentation.run()
> Hello!
>
[quoted text clipped - 46 lines]
>
> I am using .Net 1.1.4332 and Visual Studio 2003
Alan Gillott - 01 Mar 2008 08:27 GMT
whoops, that only works if the presentation is open. back to point one. you
probably need to add the presentation to the class of presentations rather
than just open it.
A
> That doesn't look right: Powerpoint programming is a minority activity but
> if the object model is consistent with Word and Excel, you will need to
[quoted text clipped - 56 lines]
>>
>> I am using .Net 1.1.4332 and Visual Studio 2003
Thomas Wieczorek - 03 Mar 2008 08:32 GMT
> whoops, that only works if the presentation is open. back to point one. you
> probably need to add the presentation to the class of presentations rather
> than just open it.
> A
Thank you for your replies.
It works for me now. The error was just that the office.dll was
missing in the .Net Runtime folder. It seems that neither Office 2007
nor the PIA installed it.
Regards, Thomas