Link to home
Start Free TrialLog in
Avatar of jackjohnson44
jackjohnson44

asked on

C# - This operation cannot be performed in this event handler.

I am getting this error:
Presentation (unknown member) : Invalid request.  This operation cannot be performed in this event handler.

I am trying to close an instance of power point from within an add-in.

Basically I open another file by launching internet explorer and providing a ulr that points to another powerpoint presentation.  This works well.

After I do that I just want to close the program that I am in, but I get the error.

Even without opening the other file, how can I just shutdown powerpoint from an add-in, that is my real problem.

        void Application_PresentationOpen(Microsoft.Office.Interop.PowerPoint.Presentation Pres)
        {
                            Process.Start("IExplore.exe", rnetlocation);
                            Globals.ThisAddIn.Application.ActivePresentation.Close();
ASKER CERTIFIED SOLUTION
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial