locked
Excel 2016 issue .CreateFile gets called before Onconnection for addin gets called. RRS feed

  • Question

  • Hello Experts,

    I observed a change in the behavior of new Excel (2016). When a user double clicks on an Excel file. Then the call to Createfile is made before the call to OnConnection for an add-in is made (verified using ProcMon). This was not the case with previous Excel version.

    I have an add-in which performs some processing before CreateFile call is made. Is there a way to disable this behavior of Excel 2016 or if there is any other method which gets called before CreateFile is called but after add-in is loaded?

    Thanks,

    rsKRISH


    • Edited by rsKRISH Tuesday, August 23, 2016 4:50 AM
    Tuesday, August 23, 2016 4:46 AM

Answers

  • >>>The code is working fine at my end. Please note that if you are building the code for Win32 office. You might need to change the project configuration to "RELEASE" and "Win32" while building (at top in Visual studio), which might be "DEBUG" and "x64" (I assume from the error message). 

    Thanks for your help, I have added this add-in successfully and reproduced this issue. 

    When I double click on an Excel file, no MessageBox show, but I disable this add-in from Com Add-ins, then reenable this Add-in, MessageBox show. 
    I have created VSTO add-in and got this same result.

    So I suggest that you could submit any feedback to Excel UserVoice:

    https://excel.uservoice.com/

    or contact Microsoft support to raise an incident so that our engineer could work closely with him to identify the root cause and resolve this issue as soon as possible.

    If the support engineer determines that the issue is the result of a bug the service request will be a no-charge case and you won't be charged. 

    Please visit the below link to see the various paid support options that are available to better meet your needs. 

    https://msdn.microsoft.com/subscriptions/bb266240.aspx

    Thanks for your understanding.

    • Proposed as answer by David_JunFeng Wednesday, August 31, 2016 1:27 AM
    • Marked as answer by David_JunFeng Wednesday, August 31, 2016 8:37 AM
    Friday, August 26, 2016 9:49 AM

All replies

  • >>>Then the call to Createfile is made before the call to OnConnection for an add-in is made (verified using ProcMon). This was not the case with previous Excel version.

    According to your description, I have download Process Monitor to try to reproduce this issue, but I am not able to reproduce it, since maybe I miss some steps. So I suggest that you could provide
    more information about this issue, for example codes, steps and screenshots, that will help us reproduce and resolve it.

    >>>I have an add-in which performs some processing before CreateFile call is made. Is there a way to disable this behavior of Excel 2016 or if there is any other method which gets called before CreateFile is called but after add-in is loaded?

    If you are developing VSTO add-in, as far as I know that The LoadBehavior entry under the Root\Software\Microsoft\Office\application name\Addins\add-in ID key contains a bitwise combination of values that specify the run time behavior of the VSTO Add-in. The lowest order bit (values 0 and 1) indicates whether the VSTO Add-in is currently unloaded or loaded. Other bits indicate when the application attempts to load the VSTO Add-in.

    For more information, click here to refer about Registry Entries for VSTO Add-ins

    Wednesday, August 24, 2016 6:33 AM
  • Thanks David, 

    I have sample VS 2015 project with me, Is there a way to share my solution directory with you? 

    And yes I am developing a COM add-in. 

    Regards,

    rsKRISH

    Wednesday, August 24, 2016 12:14 PM
  • >>>I have sample VS 2015 project with me, Is there a way to share my solution directory with you? 

    You could upload your project on OneDrive, then provide this link, I will download it, then try to reproduce and resolve your issue.

    Thanks for your understanding.
    Thursday, August 25, 2016 1:57 AM
  • Hi David, 

    The sample solution is shared at  : https://1drv.ms/u/s!AqIGpBWIejc0gvFuDqMEpgAHUE7Sfw . You need to open this solution with VS-2015 with administrator privileges and build it. It automatically registers the add-in.

    Now , when you open an Excel file it shows a message box when Onconnection() for the add-in is called. You can check using Process monitor that createFile() call for file is made before the call for loading Nativeaddin.dll is made.

    And this code works for both Excel 2016 and Excel 2013. So, you can see the difference in both these cases.

    Thanks, 

    rsKRISH


    • Edited by rsKRISH Thursday, August 25, 2016 4:39 AM
    Thursday, August 25, 2016 4:35 AM
  • >>>Now , when you open an Excel file it shows a message box when Onconnection() for the add-in is called. You can check using Process monitor that createFile() call for file is made before the call for loading Nativeaddin.dll is made.

    According to your description and steps, I have tried to open and debug your project, unfortunately, I get this error like below:


    Since this issue is complex and I am not familiar with C++, I'm trying to involve some senior engineers into this issue and it will take some time. Your patience will be greatly appreciated.

    Sorry for any inconvenience and have a nice day! 


    Friday, August 26, 2016 1:56 AM
  • Hi David, 

    The code is working fine at my end. Please note that if you are building the code for Win32 office. You might need to change the project configuration to "RELEASE" and "Win32" while building (at top in Visual studio), which might be "DEBUG" and "x64" (I assume from the error message). 

    Thanks, 

    rsKRISH

    Friday, August 26, 2016 5:12 AM
  • >>>The code is working fine at my end. Please note that if you are building the code for Win32 office. You might need to change the project configuration to "RELEASE" and "Win32" while building (at top in Visual studio), which might be "DEBUG" and "x64" (I assume from the error message). 

    Thanks for your help, I have added this add-in successfully and reproduced this issue. 

    When I double click on an Excel file, no MessageBox show, but I disable this add-in from Com Add-ins, then reenable this Add-in, MessageBox show. 
    I have created VSTO add-in and got this same result.

    So I suggest that you could submit any feedback to Excel UserVoice:

    https://excel.uservoice.com/

    or contact Microsoft support to raise an incident so that our engineer could work closely with him to identify the root cause and resolve this issue as soon as possible.

    If the support engineer determines that the issue is the result of a bug the service request will be a no-charge case and you won't be charged. 

    Please visit the below link to see the various paid support options that are available to better meet your needs. 

    https://msdn.microsoft.com/subscriptions/bb266240.aspx

    Thanks for your understanding.

    • Proposed as answer by David_JunFeng Wednesday, August 31, 2016 1:27 AM
    • Marked as answer by David_JunFeng Wednesday, August 31, 2016 8:37 AM
    Friday, August 26, 2016 9:49 AM