?
Solved

How to debug .Net Class Libraries being called from Excel VBA

Posted on 2014-04-15
2
Medium Priority
?
512 Views
Last Modified: 2014-09-08
I have two .Net projects within a solution that have their Output Type as "Class Library".

I've run into a situation where one of these is failing when a method within the .Net class is called from Excel VBA.

I have the project properties for these two .Net solution both enabled for Register for COM-Interop.  I am able to load both References in Excel VBA by selecting the .tlb files.  I used REGASM from the command prompt on both .dll files just in case and they were registered successfully.

I need to debug this on the client machine, but without being able to step into the .Net code, I have no idea why it's failing, it's some type of run-time error, but I don't have a screenshot at this point.

I need to be able to debug the .Net Class Library on the client's machine from Excel VBA in order to step into the code.  These .Net Class Libraries are set as 2.0 .Net Framework.

How would you accomplish this?


Thanks
0
Comment
Question by:JMO9966
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 27

Assisted Solution

by:MacroShadow
MacroShadow earned 1000 total points
ID: 40005089
You cannot debug an external dll in the visual basic editor.

Generally speaking you can't debug a compiled assembly, while it is possible to some extent with the aid of special debuggers, it would be a LOT easier to find out what the error is and then try to figure out where the error is triggered, you may even want to change your dll to show a message box telling you on which line the error occurred.
0
 
LVL 7

Accepted Solution

by:
Utkarsh Kulkarni earned 1000 total points
ID: 40014441
As MacroShadow rightly said, you cannot debug an external dll in VB.

It is advised to write code to handle the error & either show in message box or log that error in log file (using NLog / log4net). This will be much better as log file can point error message, stack trace, source etc.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question