LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to save data into an excel file ?

I am working on using computer to corol HP8510 Network Analyzer System. Firstlly, I save my data into a notepad.Now I want to save them directly into an excel file. Is there anybody can give me any clue?
Thanks
0 Kudos
Message 1 of 9
(5,737 Views)
To save data directly into an Excel format file, you'll need to use ActiveX.

The easiest way would be to change the delimiter on the first Array to Spreadsheet String in your application from an empty string constant to a Tab. Then Excel would be able to easily import the text file using the Tabs to define the columns and rows.

If you want to tackle the ActiveX route, try using the Report Generation Toolkit (if you have it) or there are some free ActiveX kits available.

Ed


Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
Message 2 of 9
(5,737 Views)
The easiest way is to do this is use a ".xls" extension at the end of the
filename you create. This file will open up nicely within Excel. Make sure
you use a delimeter of some sort (i use the semi-colon). I too use "Write
characters to file.vi"


(ie. My filename looks like this: "product_date_time.xls")

Regis


"jli" wrote in message
news:5065000000080000009AAD0000-1066448259000@exchange.ni.com...
> I am working on using computer to corol HP8510 Network Analyzer
> System. Firstlly, I save my data into a notepad.Now I want to save
> them directly into an excel file. Is there anybody can give me any
> clue?
> Thanks
0 Kudos
Message 3 of 9
(5,737 Views)
Thank you for you kind help. I have used a Tab constant. But what I want to do is no longer save the data into a notepad file, but directly into an Excel file. I remember once I saw examples like that, but I cant find them. So can you give me some clue?
0 Kudos
Message 4 of 9
(5,737 Views)
If I saved the data into a notepad file. Once I use Excel to open my notepad file, all the data are in one row in the Excel. What I want to do is making each data per row, but all in same column in the Excel file. Do you have any idea? A big thanks.
0 Kudos
Message 5 of 9
(5,737 Views)
The attached zip file contains several VI's to read and write directly to Excel using ActiveX. There are several example VI showing how to use everything. This set is saved in LabVIEW 6.0.2.

I suggest you unzip these to your user.lib directory so you'll be able to easily access them from the functions palette.

I have not actually used these, but others that have say they have worked well for them.

Good Luck

Ed


Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
Message 6 of 9
(5,737 Views)
jli wrote:

> If I saved the data into a notepad file. Once I use Excel to open my
> notepad file, all the data are in one row in the Excel. What I want to
> do is making each data per row, but all in same column in the Excel
> file. Do you have any idea? A big thanks.

Excel just takes the Formatting from the text.
If you want more than one row in excel, ou have to do more than one row
in the text file.

Looks like this:
Data1 Data2 Data3 Data4
0.000 0.000 0.000 0.000
1.000 1.000 1.000 1.000
2.000 2.000 2.000 2.000

And here comes the Problem. If you want to append one more row to an
existing File, you have to read in the complete file ("Read From
Spreadsheet File.vi") append your Array of Data to the array (as
additional row) and save th
e data again with the "Write To Spreadsheet
File.vi"
Your Data has to be in a 2 dimensional array for this.

I hope, this helps a bit

Bye

Marco
0 Kudos
Message 7 of 9
(5,737 Views)
The easiest way to create files for reading into Excel is probably to use the comma-separated values format, a text file where values in successive columns are separated with a comma and each line (row) is terminated with CR LF. You can write a CSV file one row at a time by passing a 1D array into Array to Spreadsheet String, concatenating the string with the end-of-line constant and then appending it to your file, which should have a .csv extension.
0 Kudos
Message 8 of 9
(5,737 Views)
Hi,

I am including a vi which shows how to write/add in an excel file whose path is already defined.

Hope it works. Your feedbacks are welcome.

Best Regards,
Nirmal Sharma
India
0 Kudos
Message 9 of 9
(5,737 Views)