Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / VB.NET / March 2008

Tip: Looking for answers? Try searching our database.

Late binding PowerPoint 2003 and 2007

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Thomas Wieczorek - 29 Feb 2008 13:07 GMT
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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.