LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Compile/Run application when required ActiveX is absent

 We are using LV 6.02. Our program uses MS Office ActiveX components. To access ActiveX we have created few SubVIs. Here are two questions:

 1. We have proper Office version installed only on one of developer's PCs. Is there any way we can compile EXE on a system without proper ActiveX installed? Now compiling EXE on a system without proper ActiveX causes build error due to non-executable VI. Let compare with other languages (for ex. C++): to be able compile C++ project it is enough to have proper interface/library (*.h/*.lib) files but not ActiveX itself. Any chance we can do the same in LabView?

 2. Is there any way VI wich uses ActiveX component still executable even when compnent is not installed? Let say I whould like export data into Excel. So I whant to check somehow is Excel ActiveX installed and if so do export using direct ActiveX calls. In case Excel is not installed I will run simple "export to ASCII" routine to export data into plain "comma separated format".

  Thanks,
     Igor.
0 Kudos
Message 1 of 6
(3,413 Views)
Hi,


You have to load and run the reporting vi's dynamically, and include the dynamic vi's as support vi's when you build the application.


Of cource, you can make one vi that creates the report, and call that one dynamically, just make sure all vi's it uses are included in the build application (e.g. save the vi as an application distribution llb).


Load and run the vi with VI Server, if it fails, you ASCII report. Search LV help for "VI Server" for details.


Regards,


Wiebe.




"jorsh" <x@no.email> wrote in message news:1139883155971-324351@exchange.ni.com...
&nbsp;We are using LV 6.02. Our program uses MS Office ActiveX components. To access ActiveX we have created few SubVIs. Here are two questions: &nbsp;1. We have proper Office version installed only on one of developer's PCs. Is there any way we can compile EXE on a system without proper ActiveX installed? Now compiling EXE on a system without proper ActiveX causes build error due to non-executable VI. Let compare with other languages (for ex. C++): to be able compile C++ project it is enough to have proper interface/library (*.h/*.lib) files but not ActiveX itself. Any chance we can do the same in LabView?&nbsp;2. Is there any way VI wich uses ActiveX component still executable even when compnent is not installed? Let say I whould like export data into Excel. So I whant to check somehow is Excel ActiveX installed and if so do export using direct ActiveX calls. In case Excel is not installed I will run simple "export to ASCII" routine to export data into plain "comma separated format".&nbsp; Thanks,&nbsp;&nbsp;&nbsp;&nbsp; Igor.
0 Kudos
Message 2 of 6
(3,395 Views)
Thanks for replay.

Second Item is relativelly easy to do. I have written simple code where I open VI reference and than check "Exec.Status" node property. It will have "Bad" value when VI is not executable.  In this case I am opening reference to the simple export_ascii.VI and then invoke "Run VI" method. This works ok.

Unfortunately first Item is not as easy as you think. As soon as I add Export_excel.VI to the build as "dynamic vi" build fails when compiling EXE with the following error message:
---------------------------------------------------
Error 1003 occurred at Export_excel.vi
Possible reasons:
LabVIEW: The VI is not executable
---------------------------------------------------

This happens because I have Excel not installed on the PC where I try to compile EXE. But this VI already should have proper ActiveX information in it (because was created on the system with proper Excel installation). This probably happens because LV try to retrive/update information from the ActiveX component when compiling EXE. There was my question - is there any way to prevent VIs having ActiveX references from updating when building application? Or what am I doing wrong?

  Thanks,
      Igor.
0 Kudos
Message 3 of 6
(3,386 Views)
LabVIEW can't compile a VI containing ActiveX if the typelib for that ActiveX object is not available and properly registered. Since the typelib of most ActiveX controls is contained in the DLL itself this usually means that the DLL itself needs to be installed. This is the same for most non C develpoment environments such as VB or Delphi.

C++ takes the actual prototypes and interfaces not from the typelib but the according header files instead.

Rolf Kalbermatter
Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
Message 4 of 6
(3,376 Views)
Thanks, I presume this from the beginning :(. So I will rephrase my question "Is there any workaround"? For example, is there any chance I can use as a reference TypeLibrary (*.tlb) file instead of real ActiveX DLL?

  Thanks,
     Igor.
0 Kudos
Message 5 of 6
(3,373 Views)


@jorsh wrote:
Thanks, I presume this from the beginning :(. So I will rephrase my question "Is there any workaround"? For example, is there any chance I can use as a reference TypeLibrary (*.tlb) file instead of real ActiveX DLL?

  Thanks,
     Igor.


If you can get this typelib and properly register it, there is a good chance that it would work. The Active X object does not really need to be loaded in order for LabVIEW to compile the VI (exception: if it is an ActiveX control that gets displayed in an Active X container), however there might be another hidden reason which might still make it fail.

Try out will be the only way to find out.

Rolf Kalbermatter
Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 6 of 6
(3,367 Views)