debug automation add in written in VS2005 for excel 2003

L

larzize

Hi
I am trying to debug an automation addin written in VB.NET 2005 for excel 2003
the code is very simple:
=============================
Imports XL = Microsoft.Office.Interop.Excel
Imports OFC = Microsoft.Office.Interop
Imports System
Imports System.Runtime.InteropServices
Imports Microsoft.Win32

<ClassInterface(ClassInterfaceType.AutoDual), ComVisible(True)> _
Public Class JDnumerics
Public Function JDmax(ByVal x As Double, ByVal y As Double)
If x > y Then JDmax = x Else JDmax = y
End Function
<ComRegisterFunctionAttribute()> _
Public Shared Sub RegisterFunction(ByVal type As Type)
Registry.ClassesRoot.CreateSubKey(GetSubkeyName(type))
End Sub
<ComUnregisterFunctionAttribute()> _
Public Shared Sub UnregisterFunction(ByVal type As Type)
Registry.ClassesRoot.DeleteSubKey(GetSubkeyName(type), False)
End Sub
Private Shared Function GetSubkeyName(ByVal type As Type) As String
Dim S As New System.Text.StringBuilder()
S.Append("CLSID\{")
S.Append(type.GUID.ToString().ToUpper())
S.Append("}\Programmable")
Return S.ToString()
End Function
End Class
==============================

I can go to Excel -> tools -> add-in -> link to the add-in
In excel i can do: "=jdmax(A1,A2)"
Everything works well.

Now, i add a break point in JDmax()
I go in project -> properties -> debug -> start external program: C:\Program
Files\Microsoft Office\OFFICE11\EXCEL.EXE
I press F5 from VS2005, excel starts
I can go to Excel -> tools -> add-in -> link to the add-in
I type the function "=jdmax(A1,A2)"
I get the result BUT i dont stop in the code

I am a bit puzzled by this (especially when I manage to make it work with C#).

How do you control which version of the add-in is loaded (debug / release) ?
What can it be?

Reason for all of this: I am moving all my librairies out of *.XLAs and
*.XLLs to VB automation add-in since it is much faster to develop in this
environment and that the difference in computational time is marginal at my
level

Any help would be most welcomed.

jerome drean
 
A

Anand.V.V.N

There is an alternative for for breakpoin, there is a command called STOP, it
is similar to breakpoint. Just type stop before the point where you want to
code to stop execution. Hoep it solves your problem

Anand
 
L

larzize

I tried STOP:
1- it compiles with no problem
2- i try - it does not stop

very strange ...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top