Immediate window

54 views
Skip to first unread message

Fer

unread,
Sep 15, 2022, 9:58:34 AM9/15/22
to Excel-DNA
Hi all,

new to Excel-DNA and Visual Studio but with some experience in VBA. I am trying to use the immediate window (or other) in visual studio to debug my code. It was easy on the VBE by using debug.print but not luck so far with Studio + ExcelDNA Any tips will be appreciated.

Thanks in advance.

Kedar Kulkarni

unread,
Sep 16, 2022, 3:49:55 PM9/16/22
to Excel-DNA
hi,

You can attach breakpoints and then view some of the variables value within visual studio. However some of the excel objects are complex so you may not be able to view all the properties. You must put a break point where code is running on the main thread.

You can use Debug.Print  - https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.debug.print?view=netframework-4.8 and the output would be printed in Visual Studio output window. 


There is a immediate window = Press Ctrl+ Alt + I

You can give commands starting with ? similar to immediate window in excel however you may get issues for com objects if Visual Studio is not able to get you the value from excel.

The locals window is also very helpful.

HTH

ExcelDebug.png
Reply all
Reply to author
Forward
0 new messages