LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Changing to Excel 2003 causes problems with Active from Labview

I have a series of VI's for importing/exporting data between Labview and Excel. These have worked in both Labview versions 6.1 & 7.1.
When we upgraded to Office 2003 (from Office 2000) there are errors. I have identified that the Excel property "Value" I was using is not listed in the Office 2003 properties and changed to "Value2" but I also get an error in the Labview vi "Variant to Data". Attached is a simple read/write routine and a spreadsheet to read from.
How do I solve this?
0 Kudos
Message 1 of 9
(4,472 Views)
The attachment didn't come through.  Please try again.
0 Kudos
Message 2 of 9
(4,453 Views)
I have a series of VI's for importing/exporting data between Labview and Excel. These have worked in both Labview versions 6.1 & 7.1.
When we upgraded to Office 2003 (from Office 2000) there are errors. I have identified that the Excel property "Value" I was using is not listed in the Office 2003 properties and changed to "Value2" but I also get an error in the Labview vi "Variant to Data". Attached is a simple read/write routine and a spreadsheet to read from.
How do I solve this?
Apparently the attachments were omitted so they are attached here.
Download All
0 Kudos
Message 3 of 9
(4,432 Views)

Hi,

What do you see in your Excel file ? The function 'weeknum' is not in my Excel that's why I get a 'type mismatch' reading the Excel data both with your as with my program.

When I delete the last 3 columns I can read the data without a problem

 

Perhaps the function 'weeknum' was made in VB in the previous version of Excel and not copied ??

Message Edited by K C on 01-09-2006 12:35 PM

Message 4 of 9
(4,425 Views)
When you upgrade to Office 2003, the ActiveX library was upgraded too, so the functions are slightly different.  You just have to change the two Value into Value2 in the Range properties, and it should work properly.  There was an error in Variant to Data because the input (output from the Range properties) was invalid.  After you change the Value2 thing, the error will go away.
 
One thing you might want to keep in mind.  If you deploy this program (for example, in .exe) to another computer, that computer have to have Office 2003 (at least Excel 2003) on it.  Otherwise, the program won't be able to connect to Excel.  You might be able to go around it if you can download the ActiveX library from Microsoft (the Excel Application library you chose when you open the ActiveX reference), but I had no luck finding it last time when I needed it.  If the target deploy computer uses a lower version of Office, you can also install that version into your development computer and choose to use the older version library when you open the ActiveX referenece in the VI (at least that's what I did).
 
Hope this helps ^_^
 
 
Message 5 of 9
(4,415 Views)
LabVIEW automatically uses the newest library available when you open the VI.
Here's some steps to what you can do to use an older version library:
 
1. Create an Application Reference
2. Right click on the Application Reference, select Select ActiveX Class -> Browse... (it'll take a while to load, so be patient, your LabVIEW didn't freeze, don't worry)
3. Click on Type Library, Select Microsoft Excel --- (11.0 is Excel 2003, 8.0 is Excel 2000) Object Library Version ---
4. Connect the Application Reference to the input of Open Excel (Excel Application In)
 
Hope this helps!
 
** Make sure you close the reference after you're done ^_^ **

Message Edited by Elsa Fung on 01-09-2006 07:02 AM

Message Edited by Elsa Fung on 01-09-2006 07:05 AM

Download All
Message 6 of 9
(4,416 Views)
Hello,
 
I have the same problem : I use Labview 8 to export data in Excel. But when I upgraded Office 97 to 2003, This VI did'nt run.
The problem is that when I right click on the  Application Reference, select Select ActiveX Class -> Browse...
I don't have -- Microsoft Excel 11.0 Object Library Version -- although  Office 2003 is installed on my PC
 
I need help please
 
 
 
 
 
 
0 Kudos
Message 7 of 9
(4,335 Views)
Hi,
  it sounds as if Excel didn't correctly register itself on your PC when it installed.
To check if the control is registered properly, you will need to use the regedit program. To run regedit, go to Start » Run, type in regedit in the text entry field and hit the OK button.

NOTE: Editing the Registry can damage your computer. Making a backup copy before modifying the Registry is strongly encouraged. To do this go to the Registry Menu and choose Export Registry File. Select "All" for the export range, and select a file name.

In regedit, please do the following:
  • Go into HKEY_CLASSES_ROOT
  • Open the "TypeLib" key
  • Under TypeLib, there should be a key called:

    {00020813-0000-0000-C000-000000000046}
This key contains the location of the type libraries for Excel. Under this key, make sure that the following subkeys have the correct data associated with them:

  • The data for the 1.0 subkey should be Microsoft Excel 5.0 Object Library
  • The data for the 1.2 subkey should be Microsoft Excel 8.0 Object Library
  • The data for the 1.3 subkey should be Microsoft Excel 9.0 Object Library
  • The data for the 1.4 subkey should be Microsoft Excel 10.0 Object Library
Depending on the version of Microsoft Office which have been installed on the system you may not have all the subkeys listed above, but you need to make sure that the existing subkeys have correct values. If the data for one of the subkey is missing, you can enter it by double clicking on the key's icon on the right side of the editor.
 
Hope that helps
 
Sacha Emery
National Instruments (UK)
// it takes almost no time to rate an answer Smiley Wink
0 Kudos
Message 8 of 9
(4,304 Views)

oops and the data for key 1.5

The data for the 1.5 key should be "Microsoft Excel 11.0 Object Library"

Sacha Emery
National Instruments (UK)

// it takes almost no time to rate an answer Smiley Wink
0 Kudos
Message 9 of 9
(4,300 Views)