NI Home > Community > NI Discussion Forums

LabVIEW

Showing results for 
Search instead for 
Do you mean 
Reply
Trusted Enthusiast
Trusted Enthusiast
Posts: 2,363

write to OPEN Excel file

How can I write to a generic Excel worksheet that is already open?
 
I want to be able to fill some cells in the Excel worksheet and do a save-as.
 
All the examples I have seen involve using ActiveX to start up Excel, open the file, select a worksheet, write to worksheet, save file, close file, and exit Excel.
 
A search showed a link to a message in the old forum.
Active Participant
mfitzsimons
Posts: 703
0 Kudos

Re: write to OPEN Excel file

Are you trying to write to any open sheet or a specific one?  The specific one may be harder because you would need to get a reference to it.

Matt

Matthew Fitzsimons

Certified LabVIEW Architect
LabVIEW 6.1 ... 2013, LVOOP, GOOP, TestStand, DAQ, and Vison
Trusted Enthusiast
Trusted Enthusiast
Posts: 2,363

Re: write to OPEN Excel file

Right now the test process is semi-automated at best. There is an Excel worksheet that is open and test data
gathered are entered manually by hand then Save-As is done for each serial number. The manual entry
is error-prone, so I am hoping to eliminate that problem.
 
After some trial-and-error using the examples on ni.com as starting point, I am able to write to the open worksheet. :smileyhappy:
Active Participant
mfitzsimons
Posts: 703
0 Kudos

Re: write to OPEN Excel file

Good Luck
Matthew Fitzsimons

Certified LabVIEW Architect
LabVIEW 6.1 ... 2013, LVOOP, GOOP, TestStand, DAQ, and Vison
Member
KPRO
Posts: 34
0 Kudos

Re: write to OPEN Excel file

To nyc, you said you had it work. Would you please show me how to write data into specific cell of the excel sheet?
Trusted Enthusiast
Trusted Enthusiast
Posts: 2,363
0 Kudos

Re: write to OPEN Excel file

[ Edited ]
KPRO,

There are several LabVIEW examples on this NI website for writing to Excel.

This is just one of them:  http://zone.ni.com/devzone/cda/epd/p/id/4523


Message Edited by nyc on 03-15-2008 10:06 AM
Member
KPRO
Posts: 34
0 Kudos

Re: write to OPEN Excel file

Hi nyc,

Thank you very much for your help. Now I can read & write from/to excel via LV