05-29-2008 12:40 PM
06-02-2008 06:29 PM
06-03-2008 04:45 PM
FieldKam wrote:
To be able to make calls to a particular library, it has to be registered with ActiveX on your system.
Yes, I tried regsvr32 (and another util I forget) but niether liked the '.olb' - is there an appropriate utility?
In any case you can browse to the library by selecting Select Class ...» ActiveX » Browse, and "Browse" again to specify the library location.
Tried it (see post) but after selecting the .olb file, browser-dialog box simply shows the Excel 11.0 Object Library as selected. Is this possibly related to older objects/methods being depreciated - and not selectable?
The other thing is that these libraries are specific to different versions of Excel, so you will have to make sure that you are using the library for a version of Excel that you also have access to.
Well, older apps need to run on newer machines without being recompiled. It seemed reasonable that by compiling with the older Object Library, the EXE might work on both the Win2K box and Win XP box. (if new Object Libraries are backward-compatible with old objects/methods.)I think this problem is handled in other languages via "late binding" where objects/methods that exist on the target are loaded at run-time. It seems LabVIEW only "early binds"(?) - requiring a manual "re-linking" step on the target (which requires the IDE.)My work-around is messay, but it emulates "late binding" by calling an OS-specific version of code at run-time.Still, it would be nice to remove this code!Cheers!
06-04-2008 05:37 PM
06-08-2008 04:24 PM
It seems that LabVIEW uses late-binding when using ActiveX refnums. The ActiveX Event Callback for Excel.vi which can be found in the NI Example Finder should work with any version of Excel granted that the version supports the Excel._Application Automation Object. You could verify this by running the example on your computer with Excel 11.0 installed, saving the VI and sending it to the customer with Excel 9.0 installed to make sure it still works. I was also able to run example VIs found on our website intended to be used with Excel2000 without any problems (I have Excel2007 installed).
I would be surprised if an ActiveX control could be created with late binding though so any ActiveX controls on the front panel will most likely use early binding and you may run into problems with different Object Libraries.
When running under the IDE, the ActiveX differences (between dev. stn and target) got resolved on the target by editing and saving there. The "Editing" consisted of finding the broken diagram and reselecting the Open method for a workbook or worksheet (I don't remember which.)
One thing that also comes to mind is if issues will only be seen in a built application. Do you know if this error is only seen in a built application or not? Did your workaround correct the issue? If so, could you post a screenshot of how you implemented the workaround for the community's benefit?
[1]Do any of the ActiveX calls work or is it one specifically that's reporting this error? [2]Does the Win2k machine have LV development? If so, you can create a debuggable executable to test that as well as testing the VI without being built into an app. Otherwise, I'd suggest using error indicators at specific key points to see when you're getting errors. If it's an issue of the early binding, I'd expect an error from the Open Automation VI. [3]Also, did the version of LabVIEW change at any point? Thanks tbd and I look forward to hearing back from you!
06-10-2008 05:49 AM
Hi tbd,
Thanks for posting your solution. As you have seen, it is often necessary to replace methods and property nodes in your application if you begin working with a newer version of the Excel Object Model.
Searching online, I found the following Microsoft documents which you may find interesting:
How to find and use Office object model documentation
How to create an automation project using MFC and a type library
06-10-2008 09:55 PM - edited 06-10-2008 10:00 PM
Hi Jennifer,
Since you've already given me credit for it
- here's my "hack" for "late-binding".
Though this kind of solution has appeared before on this forum, maybe this additional post will be helpful to someone who's stuck in a similar situation. It took me too long to figure-out that Excel would tell me what OLB to expect - see VI attached!
Cheers.

06-11-2008 12:51 AM - edited 06-11-2008 12:54 AM
Office 9.0 typelibrary supposedly is Office 2000. Version 11 is Office 2003.
@tbd wrote:
Hi Jennifer,
Since you've already given me credit for it
- here's my "hack" for "late-binding".
Though this kind of solution has appeared before on this forum, maybe this additional post will be helpful to someone who's stuck in a similar situation. It took me too long to figure-out that Excel would tell me what OLB to expect - see VI attached!
Cheers.
Message Edited by tbd on 06-10-2008 10:00 PM
06-11-2008 01:11 PM
rolfk wrote:
They have a VI library that implements the actual Excel (and Word) ActiveX nodes for each supported Office Version and needs to be added to the build as dynamic VIs. The VIs you put in your application are just CallByReference wrappers to these actual VIs. So in this way you can only support one Office version in a specific build application.
Message Edited by rolfk on 06-11-2008 07:54 AM
06-11-2008 01:34 PM - edited 06-11-2008 01:36 PM
I was refering to the Report Generation Toolkit. The different Office version libraries contain the same VIs compiled for the specific Office version. You include the one you want to support on the target into the build but can not include multiple of them into the same application.
@tbd wrote:
@rolfk wrote:
They have a VI library that implements the actual Excel (and Word) ActiveX nodes for each supported Office Version and needs to be added to the build as dynamic VIs. The VIs you put in your application are just CallByReference wrappers to these actual VIs. So in this way you can only support one Office version in a specific build application.
Message Edited by rolfk on 06-11-2008 07:54 AM
Hi Rolf,Not sure what you meant by "in this way you can only support one Office version in a specific build application" - example supports two OLBs (call to 11.0 is in a different case) but method could support an unlimited number of different Office versions.My [likely] mistake re: "late binding" somes from this post which is discussing LabVIEW polymorphism (see post by Greg McKaskle.) A search on this subject shows other (VB) programmers encounter this same problem - which they solve through explicit late-binding syntax.Cheers!