Thread: syntax
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Rob Bovey Rob Bovey is offline
external usenet poster
 
Posts: 811
Default syntax

"Don" wrote in message
...
What is the syntax for transfering the value of a varible
in VB6 into VBA, so I can use it in Excel. strQtNum has
been DIM'd in VBA. We can Import Databases, but variables
I do not know.


Hi Don,

Two ways I can think of right off the bat.

1) Have your VB6 DLL or EXE write the value of the variable to a known cell
in a worksheet of an open workbook on the Excel side and then have VBA read
the value of the variable from that cell.

2) If you have a class within your VB6 DLL or EXE that VBA has a reference
to, add a Property procedure to that class that returns the value of the
variable. Then have VBA call that property of the class to retrieve the
variable's value.

If you'd like more detail on how to implement either of these methods,
post back with a bit more detail on exactly what the relationship is between
Excel and VB6 in your project and I'll be glad to help you out.

--
Rob Bovey, MCSE, MCSD, Excel MVP
Application Professionals
http://www.appspro.com/

* Please post all replies to this newsgroup *
* I delete all unsolicited e-mail responses *