0

I am currently trying to convert a power point slides into images. It comes out this error when I tried to build the app:

Retrieving the COM class factory for component with CLSID when using Microsoft.Office.Interop.PowerPoint

I had tried the IIS "Enable-32 bit application", but it is not working. Below are my code:

using Microsoft.Office.Core;
using Microsoft.Office.Interop.PowerPoint;

public partial class Admin_powerpoint : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        Application pptApplication = new Application();
        pptApplication.Visible = MsoTriState.msoTrue;
        Presentation ppt = pptApplication.Presentations.Open(@"files/testing2.pptx", MsoTriState.msoFalse, MsoTriState.msoFalse, MsoTriState.msoFalse);

        var count = 0;
        foreach (Slide slide in ppt.Slides)
        {
            slide.Export(@"asset/images/powerpoint" + count + ".png", "png", 320, 240);
            count++;
        }
    }
}
Giulio Caccin
  • 2,962
  • 6
  • 36
  • 57
gibmefaii
  • 13
  • 1
  • 5
  • [This](https://stackoverflow.com/q/1036856/4934172) might be related. – 41686d6564 stands w. Palestine Oct 30 '17 at 11:20
  • @AhmedAbdelhameed I had tried this but in my vs, build tab, there is no platform target for me to select the x86 – gibmefaii Oct 30 '17 at 11:23
  • 1
    Microsoft has been putting a stop to this practice lately since it is getting so many programmers in trouble. A web site that uses Office scales very poorly, the web server keels over after only a couple of handfuls of visits. Not actually sure what they did about it, I *think* they just made the CLSID registry key inaccessible to service accounts. You'll need to use OpenXML instead. – Hans Passant Oct 30 '17 at 11:33

0 Answers0