COMException (0x80004005): Slides (unknown member) : Failed thrown in InsertFromFile method

2

I'm working with powerpoint presentations using Microsoft Interop library. Exception from title is thrown on adding slide to presentation via Interop library method.

File exists, path is correct, index is valid.

inpPre.Slides.InsertFromFile(tmpPathInsert, inpSldCom.SlideIndex);

This code worked as it has to for plenty of presentations and throws exception on specific slides. Error:

System.Runtime.InteropServices.COMException (0x80004005): Slides (unknown member) : Failed.
   at Microsoft.Office.Interop.PowerPoint.Slides.InsertFromFile(String FileName, Int32 Index, Int32 SlideStart, Int32 SlideEnd)

Any thoughts on why is this happens?

interop
powerpoint
asked on Stack Overflow Aug 23, 2019 by Vadim Northtsev

1 Answer

0

The PowerPoint that the file path is pointing to does not exist. Be sure to check the path and make sure it's pointing to the file you want to use. I recommend following the path exactly to see where it leads and make sure the file exists there.

answered on Stack Overflow Feb 22, 2021 by Jojo • edited Feb 22, 2021 by Jojo

User contributions licensed under CC BY-SA 3.0