LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

ERROR: Excel 97, LabVIEW 7.1 and Windows XP

Hi,
 
I began this discussion on another forum but I was mistaken in forum.
 
 
I cannot continue my development.  Christophe S. sent VIs to me which work but I do not manage to open my own Excel file.  As soon as I add a node of property or method not present in his VIs, I have the same error again.
 
I need to open an Excel file already filled.  I must modify the value of cells and the name of the various sheets of the workbook. I must also launch macros.  I already did all that at a customer with Excel 2000 under Windows98 and Windows2000 but my program does not work with Excel97.
I practically tested all the examples codes and took all the advice of the site NI on this subject but they do not work even if they must work with Excel97. I thought that perhaps it was because of the pack 2 of Windows XP but on a PC with the pack 1, I have the same result. I should pass soon on Excel2003 but I do not know yet when and I cannot stop my développment for that.
 
Did somebody already encounter this problem?  If so, how did you solve it? Thanks.
0 Kudos
Message 1 of 13
(4,364 Views)

Hi Celgi,

As i understand, my example that i have send to you does not work ?

See this web page, and let me know if this work good.

http://forums.ni.com/ni/board/message?board.id=170&message.id=9510&requireLogin=False

For this problem, i prefer that you call me to National Instrument France, and give your service request number 290626.

regards,

Christophe S.
Account Manager East of France І Certified LabVIEW Associate Developer І National Instruments France

0 Kudos
Message 2 of 13
(4,345 Views)
Thank you for your assistance. 
 
Unfortunately the link that you gave me does not function either.  I have the same error with the first node related to Excel._Application.
 
I will receive finally the new version of Office this Monday (Amazone.fr finally found my payment).  I will contact you nevertheless to know from which the problem comes.  I hope just that you speak French because I manage to write my messages only with the translator of Google.fr.
0 Kudos
Message 3 of 13
(4,340 Views)

Hi Celgi,

You have receive your new version of office !

I'ts good, because all example must be work with this version, the good way is to use new version of Microsoft Office.

And yes i speak french, then you can call me if you need (only for this problem).

regards,

Christophe S.
Account Manager East of France І Certified LabVIEW Associate Developer І National Instruments France

0 Kudos
Message 4 of 13
(4,314 Views)
Hello
 
Some of the COM objects differ between Excel 97 and Excel 2000 therfore some of the methods and /or proprties will be different between the two versions. If I remember correctly the "Cell" Property behaves slightly differently between the two versions.
 
One of the methods of the COM object for Excel is the Version Number , you could use this and then have all your code in a structure that supports multiple versions of Excel
 
I have not used Office 2003 so I can't comment on that
 
Regards
Chris R
 
 
0 Kudos
Message 5 of 13
(4,299 Views)
Excel differs from version to version. I have been catching up with this since 97.
 
Can you tell me where I can get the complete documentation for this?
 
Also, I have tried to make a VI that support all versions. But my approach was to develop and build VIs for every version. Is there a better approach? Recursively programming is very tiresome.
0 Kudos
Message 6 of 13
(4,244 Views)
In this moment, I am overloaded of work and I did not have time to carry out the tests which Chritophe S proposed to me.  On one PC, I had Office 97 but also Word2000 and Works2000.  It is possible that LabVIEW saw only ActiveX control 2000 and not 97.  From where my problems with Excel97.  I must uninstalle all that is 2000 and to remake a test with Office97. 
 
I think that it will be difficult even impossible to develop VIs compatible with all the Excel versions.  When you call a node of property or a node of method, LabVIEW "looks at" which version of Excel is installed on the PC and, if the test required by Christophe S. is conclusive, that means that it would take into account only most recent ActiveX controls.
 
If you create your VIx on PC having each one a version of Excel then that you recover on each one the program and that you finds a solution to see the version of ActiveX controls installed, you can perhaps develop your program.  But is this really useful? On the forum, we can find examples for each version. Nobody use all version in same time (more exactly of the very different versions unit).
I think that it is better to develop a new program for each version. 
Rmq:  it can perhaps exist various versions of ActiveX control for the same version of Excel.  You see that your program can quickly become painful to keep up to date.
I don't know if there are the same ActiveX problems with another programming language.  So not, you can develop a DLL with another programming language and calls it under LabVIEW, if you want to really develop your "universal" VIs.
 
I did not understand which complete documentation you sought.  On "Excel and its ActiveX controls" or on "LabVIEW and Excel"?
 
Good luck
 
0 Kudos
Message 7 of 13
(4,240 Views)
I was thinking about this yesterday.  You could continue to update your VIs as excel up revs.  Have your main VI call the excel VI dynamically.  First you can try and read the version, but if an error is returned, then try dynamically loading the next version excel loader.  Keep repeating until you have found a loader that works or you run out. 
Just a thought, but I have not tried it.  I had an issue yesterday with the renaming of a property between Excel XP(2002) and Excel 2003.

Paul
0 Kudos
Message 8 of 13
(4,232 Views)

Hi,

I replied in the thread 'Excel 97 with LabView 5.0'. In this reply I added a VI that reads the (used) cells from a Excel file. This works fine with XP and Excel 2002 but was written in LV5 for Excel 97. Select the correct ActiveX class and it should work

 

 

0 Kudos
Message 9 of 13
(4,221 Views)
The basic problem lies in the active X directory. Active X is backward compatable, so if you are witing a program on a machine with an older version of excel it should work with newer versions, but if you have ever loaded a newer version of excel on the computer then the excel active X directories will only work with the latest version of excel that was loaded or later.
 
I use multiple computers when developing application for distribution and find that the oldest one is the best for development because anything that will work on it will work with the newer versions also.
Message 10 of 13
(4,106 Views)