LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read specific cell and worksheet in excel

Hello,

 

I have multiple excel files with multiple worksheets. The worksheets default names were sheet1, sheet2, sheet3, etc.... but have been renamed to main, calculations, results, etc... ( i didn't know if this bit of information was important). I want to read a specific cell in a specific worksheet of every excel file in a directory, for example read cell "B3" in the "results" worksheet of all excel files in a certain directoy and display this value on the front panel.

 

I've been able to programtically populate a list of all the excel files in a directory, but cannot figure out how to read the files. Anyone know how to achieve this or even where to start?

 

I've seen that activex is useful in reading/writing excel files but cannot find any good refernces on how to use activex. Any help is appreciated, thanks.

0 Kudos
Message 1 of 6
(4,845 Views)

It is always helpful to us, and to you, when you post code.  Among other things, it tells us which Version of LabVIEW you are running.  We can also "guess" at your level of expertise and experience by examining the code, and adjust our comments accordingly.

 

The easiest (by far!) method of reading data from named Excel Workbooks is to use the Report Generation Toolkit.  You can use New Report to open a named Excel Workbook, Get Worksheet to open a named Worksheet, Get Excel Location to map B3 to Excel row and column, and Get Data to return the contents of the cell.

 

There are examples included in LabVIEW, and more examples here in the Forums.

 

Bob Schor

0 Kudos
Message 2 of 6
(4,832 Views)

hi

   there are number of ways to do it. Best is to use Labview report generation toolkit, but if you dont want to spend on toolkit, u can use free Labview excel librerys. example i have given a link here.  

 

https://decibel.ni.com/content/docs/DOC-39826

 

you search in google and come up a numerous other free toolkit or librerys.

 

regards

V.Senthil kumar

0 Kudos
Message 3 of 6
(4,807 Views)

Try starting with this.

"If you weren't supposed to push it, it wouldn't be a button."
Message 4 of 6
(4,777 Views)

can u see the attachment specify part in New report and advice me for solutions

0 Kudos
Message 5 of 6
(310 Views)

Hello, @mohanseenivasan.

 

    You are trying to "hijack" a Post on the Forum that is more than 8 years old!

 

     Please start a new post, explaining clearly what you are trying to do, and providing examples of code you have tried that doesn't work.  

 

     When providing your code, you should remember that many long-time LabVIEW Forum members are probably not using the most recent version of LabVIEW, so you should "Save for Previous Version" and specify LabVIEW 2019 or 2021, for example.

 

Bob Schor

0 Kudos
Message 6 of 6
(281 Views)