ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   debug automation add in written in VS2005 for excel 2003 (https://www.excelbanter.com/excel-programming/412960-debug-automation-add-written-vs2005-excel-2003-a.html)

larzize

debug automation add in written in VS2005 for excel 2003
 
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(ty pe))
End Sub
<ComUnregisterFunctionAttribute() _
Public Shared Sub UnregisterFunction(ByVal type As Type)
Registry.ClassesRoot.DeleteSubKey(GetSubkeyName(ty pe), 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



Anand.V.V.N

debug automation add in written in VS2005 for excel 2003
 
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
--
"Who will guard the guards?"


"larzize" wrote:

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(ty pe))
End Sub
<ComUnregisterFunctionAttribute() _
Public Shared Sub UnregisterFunction(ByVal type As Type)
Registry.ClassesRoot.DeleteSubKey(GetSubkeyName(ty pe), 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



larzize

debug automation add in written in VS2005 for excel 2003
 
I tried STOP:
1- it compiles with no problem
2- i try - it does not stop

very strange ...



"Anand.V.V.N" wrote:

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
--
"Who will guard the guards?"


"larzize" wrote:

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(ty pe))
End Sub
<ComUnregisterFunctionAttribute() _
Public Shared Sub UnregisterFunction(ByVal type As Type)
Registry.ClassesRoot.DeleteSubKey(GetSubkeyName(ty pe), 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




All times are GMT +1. The time now is 08:40 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com