LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Write to an Excel Named Range

Solved!
Go to solution

Hello

I am using LabVIEW 10 on windows 7 Prof. 32 bit

I can read from an excel named range, which I then bring into a 2d array (as a control)

I then want to be able to alter values in this 2d array and then write back to the same named range and saved in Excel

Can anyone help please 🙂

Lee

0 Kudos
Message 1 of 7
(3,393 Views)

It should be the same way, just do the inverse operations.  Where you read a value from a range, you will write the value to the range.

 

Post what you have so far.

0 Kudos
Message 2 of 7
(3,373 Views)

Thanks for your reply

I have attached my code and then excel spreadsheet from which I am reading from and would like to write back to.

The range would always be set to the number of columns and rows, it is just the data within each cell would be modified

 

 

Download All
0 Kudos
Message 3 of 7
(3,341 Views)
Have you tried to do anything? Your VI uses subVI's to Open, Read, and Close Excel. You didn't include those subVI's. Did you write those subVI's or get them from somewhere else? If you got them from somewhere else, then perhaps they have a Write Excel subVI? If not, you can at least look into those subVI's, see how they work, and do what I said in the earlier message.
0 Kudos
Message 4 of 7
(3,336 Views)

Yes, I got them from the developers forum, else that would have been my first option. Ideally I would like a routine XLWrite .... be great 🙂

Download All
0 Kudos
Message 5 of 7
(3,334 Views)
Solution
Accepted by topic author LeeBowers1

Look in the Read VI, and you'll see it uses an Excel Get Data, that is part of the C:\Program Files\National Instruments\LabVIEW 2012\vi.lib\addons\_office\excel.llb library.

 

Instead of using Excel Get Data, try using Excel Easy Table that is part of that library.

 

Of course you'll want to make a copy of the Read VI, and rework the code so that it writes to Excel Easy Table rather than reads from Excel Get Data.

 

Now all of this uses the Report Generation Toolkit.  While I'm sure it works, I don't know if I would use it myself.  I would use the ActiveX Excel calls directly.  They are what is buried now deep in the RGT.  You can find helpful links on manipulating Excel spreadsheets with Labview programming by looking through the Excel Board message thread.

0 Kudos
Message 6 of 7
(3,330 Views)

Thank you, I will try that

0 Kudos
Message 7 of 7
(3,325 Views)