?
Solved

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

Posted on 2009-02-11
1
Medium Priority
?
1,822 Views
Last Modified: 2013-12-17
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();
0
Comment
Question by:jackjohnson44
1 Comment
 
LVL 96

Accepted Solution

by:
Bob Learned earned 2000 total points
ID: 23620766
Hmmm...sounds like you are trying to close the presentation in the PresentationOpen event.  While I don't know the specific answer, I would think that you might try to close the presentation that is pass in as an argument.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It seems a simple enough task, yet I see repeated questions asking how to do it: how to pass data between two forms. In this article, I will show you the different mechanisms available for you to do just that. This article is directed towards the .N…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Stellar Phoenix SQL Database Repair software easily fixes the suspect mode issue of SQL Server database. It is a simple process to bring the database from suspect mode to normal mode. Check out the video and fix the SQL database suspect mode problem.

621 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question