LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Combobox linked to excel file

Solved!
Go to solution

Hi everyone,

 

I am trying to develop an interface with a combobox, an add button, an edit button, a save button and a delete button. The names that I have in an excel list (first column) should appear in the combobox, and the other information should appear in the string Indicator (Birthdate, phone and country).

 

Example of excel list :          name          Birthdate          phone         Country

                                             George       xxxxxx              yyyyyyy      UK

                                             Rick            xxxxxx              yyyyyyy      USA

                                             Jhon           xxxxxx              yyyyyyy      USA

 

Mocte117_0-1684029827249.png

 

If I click on the add button, it gives me the option to add a new name, birthday, phone and country. If I click on save, the list in excel is updated with the new fields. But if I select a name in the combobox, and click the delete button, that line should be deleted.

 

So far I know how to display the information in the string indicators, but I don't know how to link the names with the combobox and the other functions that I mentioned. Can someone help me please?

Mocte117_1-1684030559875.png

 

 

 

 

 

0 Kudos
Message 1 of 13
(2,311 Views)
Solution
Accepted by topic author Mocte117

You can play around with the array functions. I have attached a simple demo with Add feature.

-------------------------------------------------------
Control Lead | Intelline Inc
0 Kudos
Message 2 of 13
(2,275 Views)

Use 2D Array with Names and its associated information.

 

During selection use 1D array Search for Selected Name and Fetch the matching index for other information(Birth Date,Name, Phone and Country)

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 3 of 13
(2,262 Views)

@Mocte117 wrote:

So far I know how to display the information in the string indicators, but I don't know how to link the names with the combobox and the other functions that I mentioned. Can someone help me please?

Mocte117_1-1684030559875.png

 


If this "works", your "excel" file is NOT an EXCEL file, even if you give it an xlsx extension. What generated that file? 😄

 

Your loop also spins so fast that all you ever see is the last entry.

 

What should the various buttons do (for example should [ADD] add a new name that did not exist in the file? Should [delete] delete the current entry or all? What does the [edit] button do? etc. launch a popup with controls?)

 

As a first step, attach your code attempt and your data file containing tab delimited text. Explain every needed operation.

Message 4 of 13
(2,250 Views)

Personally, I would load the entries into a listbox and shift register, and update the data depending the desired action. Entering new data should use a popup. Have a look at this example. Should the entries be sorted by name?

0 Kudos
Message 5 of 13
(2,246 Views)

Hi,

 

Thank you all for the responses. 

 

I decided to use the Vi that ZYOng left me as a base, so I made modifications as you can see. I added a jump in the button add, so that instead of filling the data in the same VI, you can fill it in another VI.

 

Mocte117_2-1684104509257.pngMocte117_1-1684104491764.png

 

----------------->

 

Mocte117_3-1684104588586.pngMocte117_4-1684104603529.png

 

The actual problem is, when i click on ADD button, the data is not saved on excel. 

Mocte117_5-1684105034328.png

 

Can someone see an error in my code?

 

 

0 Kudos
Message 6 of 13
(2,233 Views)

Please attach your code. We cannot debug the screenshot.

-------------------------------------------------------
Control Lead | Intelline Inc
0 Kudos
Message 7 of 13
(2,219 Views)

As you can see from the code, the add button just adds it to the data in the shift register. It gets saved to file once you press the stop button of the main loop. If you abort the VI, any data changes are irreversibly lost.

 

Even if you correctly stop the VI, you are not writing the header row, so the first data row will get clipped on the next read.

 

This is all extremely convoluted! I have a much simpler draft on another computer, so be patient. There is no need for globals and parallel loops!

 

Message 8 of 13
(2,218 Views)
0 Kudos
Message 9 of 13
(2,209 Views)
Solution
Accepted by topic author Mocte117

See if this can give you some ideas.

0 Kudos
Message 10 of 13
(2,196 Views)