PC Review


Reply
Thread Tools Rate Thread

debug automation add in written in VS2005 for excel 2003

 
 
larzize
Guest
Posts: n/a
 
      23rd Jun 2008
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


 
Reply With Quote
 
 
 
 
Anand.V.V.N
Guest
Posts: n/a
 
      23rd Jun 2008
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(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
>
>

 
Reply With Quote
 
larzize
Guest
Posts: n/a
 
      27th Jun 2008
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(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
> >
> >

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to debug component written in VS2003 in a VS2005 application HairlipDog58 Microsoft Dot NET 9 19th Mar 2008 03:47 AM
Cannot deploy or debug with VS2005 or VS2005 BlackMDK Microsoft Dot NET Compact Framework 8 14th Feb 2008 10:21 AM
Simple VBA Code written in Excel 2003 not working in Excel 2000 =?Utf-8?B?UmljaCBCLg==?= Microsoft Excel Programming 4 3rd Aug 2007 04:36 PM
Problem deploying an automation addin (VS2005, Windows XP SP1, Excel XP) BlueTrin Microsoft Excel Programming 1 6th Jun 2006 11:29 AM
Word 2003 Find/Change Automation from Excel 2003 crashes Excel 200 =?Utf-8?B?Sm9lbCBCZXJyeQ==?= Microsoft Excel Programming 9 6th Mar 2006 10:20 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:39 PM.