none
Worksheet object in Visual Studio watch window (VSTO, C#, Excel Application Add-In, .Net 3.5) RRS feed

  • Question

  • Hi,

    I wanted to look through the properties of a worksheet(Workbook.ActiveWorksheet) during debugging, but the watch window just says that the Microsoft.Office.Interop.Excel.Worksheet interface exists in both dlls "Excel.dll" and "Microsoft.VisualStudio.Tools.Office.Excel.HostAdapter.v10.0.dll".

    How to debug the Worksheet object? I haven´t found anything similar in this forum or even in the web.

     

    Thanks in advice


    Viele Grüße Mark
    Thursday, October 6, 2011 12:33 PM

Answers

All replies

  • Hi Viele,

    Thanks for your post.

    I think you are asking about dynamic view feature of VS, check this blog:

    http://blogs.msdn.com/b/habibh/archive/2009/09/22/debugging-a-com-object-runtime-callable-wrapper-with-visual-studio-2010.aspx

    This feature is added in VS 2010, if you are working on VS 2008 or below, you can consider changing to use VS 2010

    Good day,


    Best Regards, Calvin Gao [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, October 7, 2011 7:40 AM
    Moderator
  • I don't think this answer really hit the point.

    I met the same problem today. I couldn't see the content in the watch view for the

    ((MsExcel.Worksheet )wb.Worksheets[1]).get_Range("C5", "C5") the value of it is The type 'Microsoft.Office.Interop.Excel.Worksheet' exists in both 'Excel.dll' and 'Microsoft.VisualStudio.Tools.Office.Excel.HostAdapter.v10.0.dll'


    how can I solve the problem in VS2008,
    • Edited by teragrid Tuesday, March 6, 2012 1:13 PM
    Tuesday, March 6, 2012 1:11 PM
  • Hi,

    I am not really sure, but I think my problem solved the following:

    In the VSTO project in the AssemblyInfo.cs set the ExcelLocale to false => [assembly: ExcelLocale1033(false)]

    Then excel don't use proxy objects and you can view the properties.


    Viele Grüße Mark

    Tuesday, March 6, 2012 2:00 PM