Click here to Skip to main content
13,054,329 members (118,046 online)
Rate this:
Please Sign up or sign in to vote.
See more:
I am trying to open ppt from "c:\myppts\first.ppt" with the below code. But i am getting the exception.
objApp = new Microsoft.Office.Interop.PowerPoint.Application { Visible = MsoTriState.msoTrue };
objPresSet = objApp.Presentations;
objPres = objPresSet.Open("c:\myppts\first.ppt");

But i am getting the below exception:
COMException: PowerPoint could not open the file.
Posted 21-Dec-12 20:10pm
Updated 22-Dec-12 0:15am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Try with following code
    private void btnPPT_Click(object sender, EventArgs e)
      Microsoft.Office.Interop.PowerPoint.Application pptApp = new Microsoft.Office.Interop.PowerPoint.Application();
      Microsoft.Office.Core.MsoTriState ofalse = Microsoft.Office.Core.MsoTriState.msoFalse;
Microsoft.Office.Core.MsoTriState otrue = Microsoft.Office.Core.MsoTriState.msoTrue;
      pptApp.Visible = otrue;
      Microsoft.Office.Interop.PowerPoint.Presentations ps = pptApp.Presentations;
      Microsoft.Office.Interop.PowerPoint.Presentation p = ps.Open(@"D:\AQHA\Wegbeschreibung\Reithallenplan.pptx", ofalse, ofalse, otrue);
Member 9305115 22-Dec-12 4:07am
tried same error getting

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 22 Dec 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100