Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
PM PM is offline
external usenet poster
 
Posts: 16
Default How to debug a VB dll used in Excel

Hi !

My VBA code calls a VB6 dll.

At present, not knowing otherwise, I compile my dll in vb6 (using exit subs
in place of stop points), then open Excel and my workbook, try the dll and
so forth. This is painstakingly long.

There must be a better way, trying out the dll in VB without compiling it.
Anyone know how to ?
(I guess this is really a VB question...)

Thanks.
Pat


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default How to debug a VB dll used in Excel

Pat,

This question was asked a couple of days ago.

You should be able to debug the VB6 DLL while calling its methods from
within VBA.

To do this, open the project in VB6, and step into it, and step through all
tyhe in itialisation code until it is fully initialised.

Then go to your VBA project, and step into that. Calls into the DLL will
then step into that project.

With this, you can set breakpoints, use the watch and immediate windows as
with any VB/VBA project.


--

HTH

RP
(remove nothere from the email address if mailing direct)


"PM" wrote in message
...
Hi !

My VBA code calls a VB6 dll.

At present, not knowing otherwise, I compile my dll in vb6 (using exit

subs
in place of stop points), then open Excel and my workbook, try the dll and
so forth. This is painstakingly long.

There must be a better way, trying out the dll in VB without compiling it.
Anyone know how to ?
(I guess this is really a VB question...)

Thanks.
Pat




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default How to debug a VB dll used in Excel


"PM" schreef in bericht
...
Hi !

My VBA code calls a VB6 dll.

At present, not knowing otherwise, I compile my dll in vb6 (using exit

subs
in place of stop points), then open Excel and my workbook, try the dll and
so forth. This is painstakingly long.

There must be a better way, trying out the dll in VB without compiling it.
Anyone know how to ?
(I guess this is really a VB question...)

Thanks.
Pat



Not sure if this will help, but when creating a DLL for Excel or any Office
component, I always create an executable in VB which forces the DLL to do
exactly the same thing. This way I test my DLL first in VB, and if I'm sure
it works, I start writing the VBA-calls.

You can also create a class module in Excel first, put all your code in
there, and if you're sure it works, then put it in a DLL.

To answer your other question about 10 DLL's or 10 classes - I would prefer
1 DLL, since 10 different DLL's might be confusing for both user and you.


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 205
Default How to debug a VB dll used in Excel

Hi Pm,

My VBA code calls a VB6 dll.

At present, not knowing otherwise, I compile my dll in vb6 (using exit subs
in place of stop points), then open Excel and my workbook, try the dll and
so forth. This is painstakingly long.

There must be a better way, trying out the dll in VB without compiling it.
Anyone know how to ?
(I guess this is really a VB question...)


Start by opening the VB6 dll in VB6 and clicking Debug Start with full
compile

Now switch to Excel and open the workbook. In the VBE, check Tools
References to ensure the workbook is referencing the VB6 project (not the
dll).

Once done, I find that pressing F8 steps through both the VBA and VB6 code,
switching IDEs as appropriate.


Regards

Stephen Bullen
Microsoft MVP - Excel
www.oaltd.co.uk


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I resolve debug error macro Excel 2000? At least, any lead Excel 2000 Macros debugger Excel Discussion (Misc queries) 5 October 25th 05 08:56 AM
Can i turn off the debug side of Excel? H the Layman Excel Discussion (Misc queries) 1 May 18th 05 02:06 PM
Range.calculate debug, Excel 2000 VBA compatability with Excel XP Bill Excel Programming 0 August 23rd 04 12:09 PM
VBA Crashes Excel on Compile or Stop Debug Frank & Pam Hayes[_2_] Excel Programming 0 June 24th 04 09:52 PM
Debug/Compile: Compilng excel macros? What it generates? faustino Dina Excel Programming 4 August 1st 03 07:11 PM


All times are GMT +1. The time now is 02:11 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"