none
VS2012 Unable to debug Excel 2010 or Excel 2013 Workbook /Template RRS feed

  • Question

  • Hi all,

    I have been trying to create an Excel 2013 Workbook in VS2012. Originally it was failing to create the project because the VS Excel Design time Adaptor was inactive and I could not enable it. After uninstalling Office 2013 and VS 2012, reinstalling Office and then reinstalling VS2012 and the VS Tools for Office, I was eventually able to create both Excel workbook and template projects.

    My problem now though is that if I add a Debug.WriteLine (and set a breakpoint) in the ThisWorkbook_Startup method, nothing happens. The breakpoint is not hit and nothing appears in the output window.

    I have also tried adding custom text to the worksheet and a button. On click of the button it is supposed to update a cell in the sheet. I also set a breakpoint on this. Again no breakpoint gets hit and clicking the button does nothing, although the custom text is visible in the sheet. The same thing happens with Excel Template project. It appears none of the code is being run.

    I am able to create and debug Excel 2013 Add-in though.

    I have spent the past two days trying to solve this and now I need some serious help as something appears to be missing, malfunctioning etc. I have disabled all Excel Add ins except the VS Tools for Office Design-Time Adaptor for Excel (C:\Program Files(x86)\Microsoft Visual Studio 11.0\Visual Studio Tools for Office\x86\VSTOExcelAdaptor.dll).

    I have researched everything online and nothing helps. Can anyone form MS help with this issue

    Regards

    Alan

    Thursday, July 18, 2013 10:24 PM

Answers

  • After spending several hours with Microsoft support and sending various logfiles etc, the problem turned out to be a group policy being enforced on my machine which disabled managed extensions in Excel.

    I hope this may be of help to anyone else experiencing a similar problem.

    Regards

    Alan

    • Marked as answer by Alan Rutter Saturday, September 7, 2013 11:40 PM
    Saturday, September 7, 2013 11:40 PM

All replies

  • Here's what I have just done.

    1) I started with a new machine. I installed VS2012 and all the updates.

    2) I installed the Office Dev tools for VS 2012 ENU

    3) I installed Office 2013 and removed Office 2010.

    4) I followed this walk-through http://msdn.microsoft.com/en-us/library/vstudio/cc668197.aspx to the letter

    5) I've added my directory (and sub-directories) to the Trusted Locations within Excel 2013

    6) F5 the program and I do not get any of the text added by the code - only the static text that was entered.

    My best guess here is that something is stopping the code in the customization from running but I am at a total loss as to what that may be. I really really really need some proper help.

    Regards

    Alan


    • Edited by Alan Rutter Tuesday, July 23, 2013 11:01 PM More info
    Tuesday, July 23, 2013 8:42 PM
  • Hi Alan,

    Did you run a "Build" from the Build tab prior to trying to run Debug?

    Sounds like a silly question, but it has caught me before.


    Kind Regards, Rich ... http://greatcirclelearning.com

    Wednesday, July 24, 2013 2:35 AM
  • Rich,

    F5 does a build anyway before launching the debugger, but just to be sure I did a Clean and Rebuild prior to running it. I kinda think there's a user permission that is being denied by company group policies.

    Regards

    Alan

    Wednesday, July 24, 2013 3:38 AM
  • Fei,

    Your answers assume I'm a novice - I have 25 years plus dealing with software. Without wishing to sound rude, but you obviously haven't read the problem or what I've attempted. Your answers are irrelevant and useless. Please stop posting such ridiculous answers.

    Regards

    Alan

    Thursday, July 25, 2013 7:37 AM
  • try to add System.Diagnostics.Debugger.Break(); in your methods where you want to debug - if code is hit, windows should popup window for you to choose which debugger to attach. Let us know if it works.
    Thursday, July 25, 2013 1:53 PM
  • Damian,

    I tried what you suggested but it made no difference. No window popped up.

    Regards

    Alan

    Thursday, July 25, 2013 8:30 PM
  • After spending several hours with Microsoft support and sending various logfiles etc, the problem turned out to be a group policy being enforced on my machine which disabled managed extensions in Excel.

    I hope this may be of help to anyone else experiencing a similar problem.

    Regards

    Alan

    • Marked as answer by Alan Rutter Saturday, September 7, 2013 11:40 PM
    Saturday, September 7, 2013 11:40 PM
  • Thanks for taking a moment to drop by and post the results of your investigations!

    Cindy Meister, VSTO/Word MVP, my blog

    Monday, September 9, 2013 3:08 PM
    Moderator