C# .net, Excel Addin - un expected error message - object reference not set to an instance of object RRS feed

  • Question

  • m using an Excel AddIn which is created using VSTO and build  will be done for different platforms(Win XP , win 7 - With 32 bit & 64 bit). It is throwig a pop up message box, saying that "object reference not set to an instance of object". This happens only with windows XP excel 2010. kindly let me know, if anyone can help on this.
    Monday, November 16, 2015 1:17 PM

All replies

  • What line of code fires the exception exactly? Did you try to debug the code?

    > object reference not set to an instance of object

    Most probably you are trying to use an object which is null.

    Monday, November 16, 2015 2:15 PM
  • i have tried debugging the code. It does not comes from line of code. My application does not give me any NullReference or any other kind of Exception. But after my application finishes the execution it simply gives me a exception type of message box, without any title. This is an Excel addin created using VSTO and ExcelDNA. It comes only in windows XP machine, with excel 2010 installed in it. 
    • Edited by kaviprabha Monday, November 16, 2015 2:29 PM
    Monday, November 16, 2015 2:28 PM
  • Do you release any Excel objects in the code? 

    Try to comment all the code in Excel's event handlers and see what causes the issue un-commenting the code in the line-by-line manner.

    Monday, November 16, 2015 2:30 PM
  • Releasing the objects will do, when i close the application.
    Monday, November 16, 2015 2:32 PM
  • With which software combination - especially the version of Office - did you build the project?

    Is it possible the exception is coming from Excel DNA instead of your code?

    Cindy Meister, Office Developer/Word MVP, <a href=""> my blog</a>

    Monday, November 16, 2015 4:57 PM
  • Office 2010. No. ExcelDna file is an XML file.
    Tuesday, November 17, 2015 2:25 AM
  • Hi kaviprabha,

    Do you have same issue in other windows XP machine with excel 2010?

    What’s the result if you create a new VSTO project in the VS in your windows XP machine?

    Base on the VS 2010 tools for Office runtime requirements, it requires windows XP (x86) with Service Pack 3 - all editions except Starter Edition, so please check your machine version.



    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, November 17, 2015 7:11 AM
  • Try to reproduce the issue with a newly created empty add-in. Does it work correctly?

    What add-ins do you have registered and run in Excel? Did you try to disable them and see whether it helps?

    Tuesday, November 17, 2015 12:40 PM