LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

excel don't start with a computer, but the VI works on another computer

Solved!
Go to solution

Hello,

 

I have a problem with a vi. Excel don't start on a computer.

configuration:

windows 10

Excel 2010

Labview 2019

 

I've make another VI to test the excel function

This Vi works on a computer with excel 2016 and Windows 7

 

What can I do to run this VI on the pc Windows 10 and excel 2010

 

Thank you

0 Kudos
Message 1 of 11
(2,549 Views)

Question.png

Well, after removing the unneeded sequence structure and doing a Block Diagram cleanup.

 

No, that vi is not going to work!  Perhaps if you added some information about what your subvis were doing we might be able to assist you.


"Should be" isn't "Is" -Jay
0 Kudos
Message 2 of 11
(2,533 Views)

This vi is composed by these subvi

1- open excel

2-open new workbook

3 - open new sheet

4- set cell value (number are a test )

 

see pictures

 

these vi works with Windows 7 and excel 2016, but not with Windows 10 and excel 2010

0 Kudos
Message 3 of 11
(2,491 Views)

Question1.png


"Should be" isn't "Is" -Jay
0 Kudos
Message 4 of 11
(2,477 Views)

You are running one VI on two very different machines, using different OS's, different versions of Excel, and the most recent versions of LabVIEW.  You have provided no code, but persist in showing pictures of code (do you want us to waste our time trying to re-create all of your VIs so we can test the code that "works sometimes"?  Why don't you help us to help you by providing all the VIs, say, by compressing the folder containing them and attaching the ZIP file?).

 

If you are using the Report Generation Toolkit, there are Example programs, including one written about 5 years ago that you might check out and see how it performs on your two systems (on the first page of the Forum, search for "Revised Excel" -- I think the key word is "Revised").  This is a complete VI, so you should just be able to download and run ...

 

Bob Schor

0 Kudos
Message 5 of 11
(2,455 Views)

sorry,

 

here is the files

0 Kudos
Message 6 of 11
(2,447 Views)

Am I correct that you are trying to run Excel without the Report Generation Toolkit, perhaps using ActiveX or something like that?

 

I've taken a quick look at your Test Excel VI.  I made a few "cosmetic" changes.  Do you understand how Data Flow works?  You absolutely don't need (and shouldn't use) the Frame Sequence Structure here.  Keeping wires short and straight simplifies looking at the VI.Test Excel (the hard way)Test Excel (the hard way)

I gave up on ActiveX for Excel a long time ago (once I discovered the Report Generation Toolkit).  Here's how I'd do this now:Test Excel (RGT)Test Excel (RGT)

If you don't have the Report Generation Toolkit, then I apologize for wasting your time.  Until I saw the VIs that you attached, I really didn't "get" what you were trying to do.

 

Bob Schor

0 Kudos
Message 7 of 11
(2,418 Views)

this sequence is a part of an old labview program.

 

I've modernized to adapt with a new instrument but the program don"t run excel with a new computer (Windows 10 excel 2010 labview 2019). The rest of the program works. So with the test VI i try to test why excel doesn't work.

 

. I've tryed to launch excel with a simplified progrma but it doesn't work.

 

thank you for your response.

0 Kudos
Message 8 of 11
(2,401 Views)
Solution
Accepted by topic author 968012

Thank you for attaching your VI.  I do understand that this is an old program, one you probably didn't create, but it is a mess, making it very difficult to understand, difficult to maintain, difficult to improve, but possibly fairly simple to re-create by someone with moderate LabVIEW skills.  Here are some suggestions:

  • You have 10 "voie" quantities, with a Control, an Indicator, and a Boolean associated with each.  This suggests an "Array of 10" instead of 10 individual Controls/Indicators (much simpler to organize on Front Panel, much simpler to handle on Block Diagram with For Loop and other Array functions).
  • You can associate the Measure (M1), the numeric value (not named on Front Panel), and the the Auto/Manual Switch for each "Voie" by creating a Voie Cluster of three elements.  This "binds" the three parts together and again greatly simplifies the code.
  • Why is the Mesure 7 Control given the (displayed) Caption "M10"?  Why are you displaying Captions, rather than Labels, especially when the numbering is not consistent?  This can only confuse the User, I think.
  • Once you get 10 Numeric Controls, 10 Numeric Indicators, and 10 Boolean Switches simplified to an Array of Clusters (or a Cluster of Arrays, whichever logic makes more sense), your code will immensely simplify and you can get rid of the Frame Sequences and replace it with a State Machine (or something similar) architecture, again making the code much more understandable and easier to modify.  Not only do you have Frame sequences, you have them nested to a depth of three!  Think Sub-VIs, encapsulate function.
  • A good way to start is to write some high-level documentation (say a page or two) saying What the program is supposed to do.  Don't place any "details" in this document, that is, say what the code does, not how to do it (I hope to convince you to do it completely differently!).
    • For example, you would say "Initialize variables by reading data from several files, including config.alc (which initializes the Measure variable), #summary.sta (which initializes some Measurements), initialize plots, ...
    • Note that having one variable with the "Measure Cluster" in it means such things as setting the Plot.Name values for Graph 1 is done with one simple (and small) For Loop.
  • Learn better String Handling.  Learn how to use Spreadsheet String to Array to change a multi-line String into an Array of Strings, which allows you to easily fill an Array of Measures from an Array of values read from a file.
  • Use sub-VIs to "hide" irrelevant code that does initialization, reformatting, things that are necessary but not central to the essential task you are doing (such as initialization!).
  • Use the Error Line everywhere you can to ensure that (a) you'll "trap" (and know about) any errors that may arise, (b) you will specify in an obvious way the order you need for your code to work properly, and (c) having a horizontal Error Line will help keep your Block Diagram "neat" and easier to understand.
  • When you are finally ready to use Excel, use the Report Generation Toolkit.  If it is not included in your License, purchase it -- it will repay you by allowing you to easily read/write Excel, works with Windows 10, works with LabVIEW 2019, works with Excel 2013 and later (and probably earlier), is currently supported by NI, etc.

Bob Schor

Message 9 of 11
(2,382 Views)

Thank you for yours advices.

 

I didn't create this program. I'm automation engeener and I've discovered Labview with this program. I'm doing Grafcets to réorganize this program and make subvi. I've to insert a second measuring instrument with VISA. I tried to call a specialized socety but they estimate 15 000$ for this project

 

Just a last question: Do you have any reliable vi with an excel example to test the new computer before take hours to develloping a new program.

 

 

0 Kudos
Message 10 of 11
(2,357 Views)