LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read Range of Cells in Excel ActiveX

I need to write data into an Excel file using ActiveX. Writing to the file won't be a problem ... but I'm really stuck on an "append to existing file" - type function. I've been poking around this forum for hours and just can't find exactly what I need.
 
I simply want to pull up an existing Excel file and have it tell me the last location in the range of cells containing data. This is possible in uSoft Spreadsheet but I can't find it in Excel. Looping through and reading each cell one at time looking for the last empty one won't work since the appended data needs to be separated by an empty line to make it more readable.
 
Thanks in advance.
 
 
PaulG.

LabVIEW versions 5.0 - 2023

“All programmers are optimists”
― Frederick P. Brooks Jr.
0 Kudos
Message 1 of 8
(4,147 Views)

THis post by Michael Monroe in the Excel thrad found in the BreakPoint he claims to have posted code that lets you find the end of the sheet.

It was too late for me to use in my app. In my case, I set aside a cell that tells were the next entry should be inserted. I update that cell after I write the sheet.

If you try it and it works, please post back!

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 2 of 8
(4,143 Views)
Michael Monroe's Excel 2k vi's seem to work perfectly. The even ignore skipped lines. Thanks Ben.
PaulG.

LabVIEW versions 5.0 - 2023

“All programmers are optimists”
― Frederick P. Brooks Jr.
0 Kudos
Message 3 of 8
(4,139 Views)

"...seem to work perfectly." I'll keep that in mind for the next I am asked.

Thanks!

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 4 of 8
(4,134 Views)
I looked through every one of the hundred or so Excel._Worksheet properties and must have missed UsedRange. That might have been my first clue.
 
Where's that beating-my-head-against-the-wall icon? Smiley Very Happy
PaulG.

LabVIEW versions 5.0 - 2023

“All programmers are optimists”
― Frederick P. Brooks Jr.
0 Kudos
Message 5 of 8
(4,130 Views)

Here's one

Other emoticons can be found under the tag "Emoticon".

Is there anything else you want help with? Smiley Very Happy

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 6 of 8
(4,123 Views)
Perhaps. In this post, Devin was looking for a "slaps forehead" smiley/emoticon. Got one of those? Smiley Very Happy

P.S. I also noticed your link didn't work. It just takes me to the main listing of all the forums. Could it be because I have tagging disabled?


Message Edited by smercurio_fc on 01-10-2008 05:37 PM
Message 7 of 8
(4,109 Views)

These and many others are available as part of the CC & Friends project. (Make sure you have the latest config)

The other two threads under the tag emoticon are here and here.

Not being able to post a link to a tag listing is a drag.

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 8 of 8
(4,104 Views)