LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Adding VBA to a Labview application

Microsoft has a set of controls available to add Visual Basic for
Applications to any application that is a ActiveX server (i.e Labview). Has
anyone tried this?

It seems that when starting the control it needs a reference to the
application object, but I'm sure if that should be an Application or a VI
reference. Also the reference should be a variant, but when I connect a LV
reference to the variant I get a broken wire. The control also needs a
reference to hWnd (pointer to main window), but I don't know where to find
that? When initializing I get a LicenceKey error. The control evidently
can't validate if LV is allowed to use it (while I'm using the correct
(evaluation key).

Is there any chance that I could get this
to work? Or should VBA be included
by the NI?

What I'm trying to do is give users of LV applications some way to customize
it, i.e. even though a certain test setup consists of the same instruments,
the actual measurements that need to be done vary from case to case (in an
R&D environment). By modifying the script any user (not familair with LV)
can adapt the measurement setup.

I have been able to add vbscript to LV, but that doesn't have a script
development IDE like VBA.

Ferry Toth
Enraf BV, Delft, The Netherlands
0 Kudos
Message 1 of 4
(2,950 Views)
I don't have the answer for the first part, but for the last part:
if I got it well, you want to run a VBA script starting from LAbVIEW. You
can do it with EasyMacro.vi (http://www.easymacro.com). It runs a VBA script
from LAbVIEW.
Rick

"Ferry Toth" wrote:
>Microsoft has a set of controls available to add Visual Basic for>Applications
to any application that is a ActiveX server (i.e Labview). Has>anyone tried
this?>>It seems that when starting the control it needs a reference to the>application
object, but I'm sure if that should be an Application or a VI>reference.
Also the reference should be a variant, but when I connect a LV>reference
to the variant I get a broken wire. The control also needs a>reference to
hWnd (pointer to main window), but I don'
t know where to find>that? When
initializing I get a LicenceKey error. The control evidently>can't validate
if LV is allowed to use it (while I'm using the correct>(evaluation key).>>Is
there any chance that I could get this to work? Or should VBA be included>by
the NI?>>What I'm trying to do is give users of LV applications some way
to customize>it, i.e. even though a certain test setup consists of the same
instruments,>the actual measurements that need to be done vary from case
to case (in an>R&D environment). By modifying the script any user (not familair
with LV)>can adapt the measurement setup.>>I have been able to add vbscript
to LV, but that doesn't have a script>development IDE like VBA.>>Ferry Toth>Enraf
BV, Delft, The Netherlands>>
0 Kudos
Message 2 of 4
(2,950 Views)
What I want to do is add a control to LV that add's the VBA ide, so the user
of a LV application can macro's and VBE code to adapt the behaviour of the
LV application.

Until now, I have been able to add the VBA control's, but can't get it
initilized. Apperarently the VBA control tries to communicate with it's host
(in this case LV) using ActiveX, and expects a certain method or property.
So it seems you can't use VBA without having NI modify the LV executable -
or at least I don't know how.

I have been able to add the VBscript control (add IE scripting to a host
application), which doesn't have a IDE that it wants to integrate into the
host. The VBScript language is however somewhat limited.

Ferry

Rick wrote in message
news:38d0c884@n
ewsgroups.ni.com...
>
> I don't have the answer for the first part, but for the last part:
> if I got it well, you want to run a VBA script starting from LAbVIEW. You
> can do it with EasyMacro.vi (http://www.easymacro.com). It runs a VBA
script
> from LAbVIEW.
> Rick
0 Kudos
Message 3 of 4
(2,950 Views)
"Rick" schreef in bericht
news:38d0c884@newsgroups.ni.com...
>
> I don't have the answer for the first part, but for the last part:
> if I got it well, you want to run a VBA script starting from LAbVIEW. You
> can do it with EasyMacro.vi (http://www.easymacro.com). It runs a VBA
script
> from LAbVIEW.
> Rick

No, I want to add Visual Basic for Applications to a LabVIEW application,
giving users the opportunity to custemize the LabVIEW application without
programming it.

I had succes in the past adding VBScript to a LabVIEW application. But VBA
seems to be more powerfull and standardized across office applications.

Ferry
0 Kudos
Message 4 of 4
(2,950 Views)