08-12-2010 12:03 PM
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
08-12-2010 12:18 PM
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.
08-12-2010 12:26 PM
If you have the "Report Generation Toolkit", it has EXCEL functions that let you do that.
08-12-2010 12:26 PM
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?
08-12-2010 12:28 PM - edited 08-12-2010 12:30 PM
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.
08-12-2010 12:47 PM
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
08-12-2010 12:57 PM
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.
08-12-2010 12:58 PM
You might find some help in the thread
http://forums.ni.com/t5/BreakPoint/Excel-Board/td-p/379682
08-12-2010 01:04 PM
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.
08-12-2010 01:28 PM
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.