Discussion:
Reading VB6 Variables from VBA
(too old to reply)
Mark
2009-03-02 02:35:01 UTC
Permalink
Is there a way read VB6 Variables from Word VBA
I have a vb6 program which stores the users department in a public variable
called "dept", can I read this variable information from VBA
fumei via OfficeKB.com
2009-03-02 19:17:02 UTC
Permalink
Your VB6 application (if running of course) can pass the variable to VBA by
creating an instance of Word, and using Word VBA. But it is the VB6
application that has to do it. So technically, "can I read this variable
information from VBA" - with th emphasis on "from", no.

VB6 app can pass the variable TO a VBA procedure in Word if the VB6 app
created that instance of Word. After all, that public variable is only
available if the VB6 app is executing.
Post by Mark
Is there a way read VB6 Variables from Word VBA
I have a vb6 program which stores the users department in a public variable
called "dept", can I read this variable information from VBA
--
Message posted via http://www.officekb.com
David Horowitz
2009-03-03 17:44:18 UTC
Permalink
Another way to handle this, in addition to what has already been suggested,
is to make sure the VB6 program is a COM server and expose whatever public
variables and/or subs/functions you want.
I don't remember all the settings you need to use in VB6 to make this happen
but it's really pretty simple. It's something like in the Solution Explorer
in VB6, setting the Instancing property of the class to Public or Creatable
or similar, and maybe some setting in the Project also...
--
David Horowitz
Lead Technologist
Soundside Inc.
www.soundside.biz
Post by Mark
Is there a way read VB6 Variables from Word VBA
I have a vb6 program which stores the users department in a public variable
called "dept", can I read this variable information from VBA
Loading...