Click here to Skip to main content
15,887,135 members
Please Sign up or sign in to vote.
4.50/5 (2 votes)
hi,
i am working on Office PowerPoint 2007 using c#. i want to open the powerpoint document, so i have done some code for the same. but am facing one problem. i have attached code spinet as follow.


Microsoft.Office.Interop.PowerPoint.Application ppApp = new Microsoft.Office.Interop.PowerPoint.Application();
           ppApp.Visible = Microsoft.Office.Core.MsoTriState.msoTrue;
           Microsoft.Office.Interop.PowerPoint.Presentations oPresSet = ppApp.Presentations;
           Microsoft.Office.Interop.PowerPoint._Presentation oPres = oPresSet.Open(@"D:\Office Guru Support Files\temp.pptx",
           Microsoft.Office.Core.MsoTriState.msoFalse, Microsoft.Office.Core.MsoTriState.msoFalse,
           Microsoft.Office.Core.MsoTriState.msoTrue);


i am getting exception as follow...

<big></big>The type 'Microsoft.Office.Interop.PowerPoint.Application' exists in both 'f:\Office Guru\PreworkArea\OfficeWork\OfficeWork\obj\Debug\Interop.Microsoft.Office.Interop.PowerPoint.dll' and 'c:\Program Files\Microsoft Visual Studio 9.0\Visual Studio Tools for Office\PIA\Office11\Microsoft.Office.Interop.PowerPoint.dll'	F:\Office Guru\PreworkArea\OfficeWork\OfficeWork\Form1.cs


can anyone know the solution to this problem?...its on urgent basis.
Posted

1 solution

Looks like an issue of conflicting dlls - you have probably referenced two dlls

1) Interop.Microsoft.Office.Interop.PowerPoint.dll'
2) Microsoft.Office.Interop.PowerPoint.dll'

both of which contain references to Microsoft.Office.Interop.PowerPoint.Application().

You might want to remove one reference and try again.
 
Share this answer
 
Comments
meBalkrishna 29-Nov-10 2:37am    
Thanks You sir. It was because wrong reference that was provided.
Abhinav S 29-Nov-10 11:12am    
You are welcome. If this helped, you can always mark the question as answered. Thanks. :)

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900