Free Support Forum - aspose.com

Help! Error locking me out of PPT file

I am a new user evaluating the Aspose.PowerPoint component. I just tried going through the Quick Start walk-through project (the one that puts Hello World in the PH1 field of a PPT). I got an error the first time I compiled and ran my project (it could not find the field with PH1 in it).

My bigger problem however, is that because the error occured while the Aspose.PowerPoint compoent was working with the file, the PPT file (demo.ppt) is now permantly locked-out. When I try to open the PPT in MS PowerPoint, I get a "demo.ppt is being modified by [myusername]. Do you want to open a read-only copy?" error message box. This lock-out still occurs even if I completely close the sample application and Visual Studio. The only way that I can unlock the file and re-open it is by shutting down and restarting my PC!

Is there any way to fix this file manually without restarting my PC? More importantly, is there any way to prevent this from happening in the code. I noticed that the presentation object does not appear to have any sort of exit or close command that I could include in a try-catch block. How do I force Aspose.PowerPoint to close and let go of a file?

Thanks,

Erik-Sasco

Dear Erik,


  1. Could you write how you search frame with PH1 text? Text can be in a
    TextHolder or Shape. So you should check both collections
    Slide.Placeholders and Slide.Shapes. Also if you use static template
    presentation you can search by AlternativeText.

    Please check Programmer’s Guide in the Wiki.


  2. Really files shouldn’t be locked but if you use it from asp.net application you can simply kill aspnet_wp.exe process.

    I’d suggest to use Presentation constructor with stream instead of
    filename. In this case you can close stream by yourself in case of
    errors.