none
VSTO add-in loading when excel is started through Windows Scheduler. RRS feed

  • Question

  • Hi,

    I have an issue when excel with VSTO add-in is started via Windows scheduler. I have certain job to perform when excel workbook is opened.

    My logic gets the Object property of COM add-in and based on that i'm performing the job. This works perfectly if excel is opened normally but not via Windows scheduler.

    If i open the excel workbook with Windows Scheduler, the add-in loads after the workbook is opened. (So the Addin's Object property returns null). Ideally, one would expect add-in to load first when application is opened and then workbook to open.

    I see the timing issue in this scenario. Is there any way we could open the excel application with all the add-ins loaded before workbook is opened. 

    I'm using VS2008 with Excel 2007 as my dev setup.

    Any suggestions regarding this is will be very helpful.

    Thanks in advance.

     


    Regards, Subhash Sreenivasachar
    Tuesday, July 26, 2011 8:38 AM

All replies

  • Sometimes it works to put a loop in Startup that does a Workbooks.Count. Let the loop run (with Doevents) until the Count > 0?
    Cindy Meister, VSTO/Word MVP
    Tuesday, July 26, 2011 9:27 AM
    Moderator
  • Hi Cindy,

    Thanks for your reply.. Unfortunately, it did not help in my case. Actually, i'm calling a COM Interface (CCW) from excel workbook via Macros and in the .net CCW i'm checking if add-in is loaded, that is where the issue occurs.. Not sure if i'm properly conveying the issue to you..

    Is there any other way to overcome this issue.


    Regards, Subhash Sreenivasachar
    Tuesday, July 26, 2011 9:50 AM