none
WorkbookOpen event is not triggered when launching EXCEL from command line RRS feed

  • Question

  • Hi,

    I work on a office add-in. When EXCEL is launched via CreateProcess to open a document, WorkbookOpen event is not triggered. The same issue occurs when I launch EXCEL from command line manually, i.e. running EXCEL.EXE Book.xlsx does not trigger WorkbookOpen event. However the event is triggered when I open the document from file explorer via double click. Is there any command line option which will make WorkbookOpen even to be triggered? Inside the event handler I am updating doc caption. I am using Office 2016. 

    Thanks

    Thursday, April 5, 2018 10:50 AM

Answers

  • Hi Davit93,

    You had asked,"Is there any command line option which will make WorkbookOpen even to be triggered?"

    Yes, You can try to "Start" to open excel file which can trigger Workbook Open event.

    start C:\Users\abc\Desktop\Book3.xlsm

    Output:

    Regards

    Deepak


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Proposed as answer by Ashidacchi Thursday, April 5, 2018 12:57 PM
    • Marked as answer by Davit93 Thursday, April 5, 2018 1:58 PM
    Thursday, April 5, 2018 12:52 PM
    Moderator

All replies

  • Hi Davit93,

    You had asked,"Is there any command line option which will make WorkbookOpen even to be triggered?"

    Yes, You can try to "Start" to open excel file which can trigger Workbook Open event.

    start C:\Users\abc\Desktop\Book3.xlsm

    Output:

    Regards

    Deepak


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Proposed as answer by Ashidacchi Thursday, April 5, 2018 12:57 PM
    • Marked as answer by Davit93 Thursday, April 5, 2018 1:58 PM
    Thursday, April 5, 2018 12:52 PM
    Moderator
  • I agree with Deepak.....

    I recommend to use data file name, instead of exe file name. We can expect for file association to do the righg thing.


    Ashidacchi -- http://hokusosha.com/

    Thursday, April 5, 2018 1:01 PM