LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can I use Set File Position to write to a specific cell in excel?

Hi,

 

I am trying to write data to an excel spreadsheet template so I can gather data automatically.  The problem I am having is that while I can get labview to open up the template I want to use I can't figure out how to set the data to write starting in a specific cell.  Is this set in the "refnum" terminal?  Any info would be greatly appreciated.

 

thanks,

Brian

0 Kudos
Message 1 of 11
(5,446 Views)

Refnum terminal of what? Are you using the report generation toolkit or a modification of the example called 'Write Table to Excel'? Set File Position has nothing at all to do with connecting to Excel. That requires ActiveX like the toolkit and example uses.

 

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

If you have the "Report Generation Toolkit", it has EXCEL functions that let you do that.

Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 3 of 11
(5,435 Views)

Well, I'm new to labview so maybe I don't understand how exactly ref nums work but, looking at the detailed help on "Set (or Get) File Position" it looks like you can control where data is read/write from.  I just want to have labview open up an excel template that I have and write data to a specific cell (for example: cell d15)

 

Is ActiveX included in labview or is it an add-on that must be purchased?

 

 

 

0 Kudos
Message 4 of 11
(5,434 Views)

ActiveX connectivity is included in LabVIEW, haven't used it to do the EXCEL calls directly, a little lower level than I wanted to deal with.

 

There are examples in the LabVIEW "Help" (search EXCEL") that show some examples of talking to Excel.

Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 5 of 11
(5,431 Views)

yeah, I've been looking there for quite some time.  i either don't understand how to use what is suggested or (more frequently) it doesn't apply

0 Kudos
Message 6 of 11
(5,416 Views)

Just forget about Set File Position. Unless you are intimately familiar with the binary format of Excel files, it will do you no good.

 

ActiveX is your only option when you want to write to native Excel files. The documentation on the properties and methods are part of the Excel help.

 

The Write Table to Excel example that I mentioned has a function to set the row and column to write the LabVIEW table to. This example is probably one of the simpler ActiveX examples. Run it and experiment with different settings.

Message 7 of 11
(5,411 Views)

You might find some help in the thread

 

http://forums.ni.com/t5/BreakPoint/Excel-Board/td-p/379682

Tim
GHSP
0 Kudos
Message 8 of 11
(5,407 Views)

Note to "MechE punk": The Excel Board is a thread intended to be a repository of links only. Do not post questions on that thread.

0 Kudos
Message 9 of 11
(5,401 Views)

Thanks.  I guess I'll do some experimenting and try to figure this out by myself.  Additionally, I found this in the "code sharing" tab when I did a "write to excel" search on NI Developer Zone.  With any luck I might be able to adapt it to read the necessary data from my VI and save it to the template I'm trying to incorporate.

 

 

http://decibel.ni.com/content/docs/DOC-2081

0 Kudos
Message 10 of 11
(5,385 Views)