View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Doug Glancy Doug Glancy is offline
external usenet poster
 
Posts: 770
Default VBA and VB6 functions return different answers?

Andy,

You can debug your code by adding a windows project with a Sub Main to your
dll project. In that project you can have a few lines of code that use
getobject(excel) to define the excel instance and call the dll. The
combination of the activex and windows project are called a project group.

hth,

Doug


"Andy" wrote in message
...
I have a working set of classes and routines in Excel 2003 written in VBA.
They return the correct answers. The various functions do goal seeking
and
reading and changing various cells in my spreadsheet.

I created an activex dll in VB6 and moved the code over. I included the
Excel object library and other required bits and pieces.

The problem is that the VB6 routines return into Excel a completely
different answer. One of the functions returns a double which should be
0.14426%
and instead returns 0.00028%.

All of the code moved cleanly into VB6 with the exception of routines
which
acted upon Excel cells (goto cells, pasting cell values from the .dll,
etc.).
All of these items take the array or cell and pass it into VBA to be
dropped
into the spreadsheet.

Is a double not a double? Any pointers?

Thanks all

Andrew

I'm not even sure how to go about debugging a .dll called by Excel.