none
VSTO Excel WorkbookOpen Event When double click a File RRS feed

  • Question


  • Hi all, i need your help. 
    I've developed an excel addin for office 2007 and now i migrated to 2010.

    Im expriment a problem with the WorkbookOpen Event.

    If i use File -> Open (and select a file) the event is fired.
    if i double click a file it doesnt run the event.

    I paste a test i did.

    I'll appreciate any help

    Thanks in advance!

    public partial class ThisAddIn     {          void Application_WorkbookOpen(Excel.Workbook Doc)          {              MessageBox.Show("Application_WorkbookOpen");                      }         private void ThisAddIn_Startup(object sender, System.EventArgs e)         {             this.Application.WorkbookOpen += new Excel.AppEvents_WorkbookOpenEventHandler(Application_WorkbookOpen);                      }

    private void InternalStartup()

          {

                this.Startup += new System.EventHandler(ThisAddIn_Startup);

                this.Shutdown += new System.EventHandler(ThisAddIn_Shutdown);

            }




    Tuesday, June 18, 2013 2:05 AM

Answers

  • Sorry for the delay of my post. It seems to be only on my pc... may be an installation problem.

    But is a stranger error because it happend only on the double click.

    Thanks,

    Monday, July 8, 2013 7:40 PM

All replies

  • Hi Holden-ar,

    Thank you for posting in the MSDN Forum.

    I've tried your code and it works fine on my side.

    What if you try to clean this solution and create a new one?

    I look forward to your reply.

    Best regards,


    Quist Zhang [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, June 20, 2013 7:16 AM
    Moderator
  • That's what i did, i've created a new blank project and the error continues.

    what  i've noticed, after many hours and testings,  that the double click is not firing the Application_WorkbookOpen in my pc, but in others works as expected

    Could it be an Update? an Excel Setting?

    Thank you for your time.

    Friday, June 21, 2013 2:23 PM
  • Hi Holden-ar,

    You can check the value of Application.EnableEvents Property.

    Can other events be triggered normally?


    Quist Zhang [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, June 25, 2013 6:56 AM
    Moderator
  • Sorry for the delay of my post. It seems to be only on my pc... may be an installation problem.

    But is a stranger error because it happend only on the double click.

    Thanks,

    Monday, July 8, 2013 7:40 PM