LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to Save a Table Data to Excel File

Solved!
Go to solution

@RTSLVU wrote:

@crossrulz wrote:

RTSLVU wrote:

You know if you make a text file with a TAB delimiter and give the file a .xls extension it opens in Excel just fine. I do it all the time.


You really should not do that.  It makes Excel do extra work.   But Excel can open up *.txt files just fine.  So I save my tab delimited text files with an extention of txt and then edit them with Excel.


Yes, but you have to go through the "import"  process every time and tell Excel the file is tab delimited, that's a P.I.T.A.

 

And it confuses my managers if I send them a raw data file that will not open directly in Excel by double clicking on it, as double clicking a txt file opens in Notepad by default.

 

Putting a .xls opens it right up in Excel, but Excel 2010 and newer will say it's not really an Excel file but allow you to open it anyway.

 

Right or wrong I find it is eaiser for everyone if I do that.


If you save it as a CSV file (comma delimited, .csv file extension), then it will open directly in Excel without going through the "import" process.

Though I guess commas my not be appropriate in all parts of the world as commas are used as the decimal separator in same places.

0 Kudos
Message 11 of 20
(1,563 Views)

@MIG wrote:

If you save it as a CSV file (comma delimited, .csv file extension), then it will open directly in Excel without going through the "import" process.

 


 

Actually that is not always true.

 

We also use Agilent Benchlink software with our Agilent 34970A's and it exports a .CSV file

 

But since MS Office 2007 Excel has been unable to open these CSV files directly by double clicking on them even though they are associated with Excel.

 

Double clicking on them makes you go through the import process, and the import process defaults to TAB delimited so if you are not paying attention you end up importing it wrong. (again confusing managers and anoying engineers)

 

Intrestingly enough if you start Excel and then use the File-Open dialog it opens them just fine.

 

-------------------------------------------------------------------
Unfortunately, most readers of this Forum, including some real Experts, have not mastered the skill of being able to read the code that Posters fail to post. If we cannot see "what you did wrong", we are unable to tell you how to fix it. (Bob Schor 28 August 2018)
0 Kudos
Message 12 of 20
(1,554 Views)

@RTSLVU wrote:

@MIG wrote:

If you save it as a CSV file (comma delimited, .csv file extension), then it will open directly in Excel without going through the "import" process.

 


 

Actually that is not always true.

 

We also use Agilent Benchlink software with our Agilent 34970A's and it exports a .CSV file

 

But since MS Office 2007 Excel has been unable to open these CSV files directly by double clicking on them even though they are associated with Excel.

 

Double clicking on them makes you go through the import process, and the import process defaults to TAB delimited so if you are not paying attention you end up importing it wrong. (again confusing managers and even some engineers)

 

Intrestingly enough if you start Excel and then use the File-Open dialog it opens them just fine.

 


Interesting. I use LabVIEW to create .csv files, and with both Excel 2010 and 2013 (not sure about Excel 2007, I no longer have it) I can just double-click on the .csv file and it opens in Excel without going through the import process.

Not sure if there's something different about the Agilent .csv file which would cause the different behaviour in Excel.

0 Kudos
Message 13 of 20
(1,549 Views)

I just went back and looked, the problem with opening the CSV files from the Agilent software started with Excel/Office 2003.

 

I tracked it down to the Agilent was exporting text in Unicode and it needs to be in ASCII for Excel to recognise it properly.

The confusion this caused made us move away from .CSV files and using TAB delimited text files with a .XLS extension.

 

Like I said before right or wrong it eliminated a lot of headaches for the end user so I will continue to do this and recommend it to others.

-------------------------------------------------------------------
Unfortunately, most readers of this Forum, including some real Experts, have not mastered the skill of being able to read the code that Posters fail to post. If we cannot see "what you did wrong", we are unable to tell you how to fix it. (Bob Schor 28 August 2018)
0 Kudos
Message 14 of 20
(1,539 Views)

One more thing, I have the Office/Excel tool kit in my LabView, there are a couple reason's we do not use it.

  1. It requires Excel to be installed on the target machine.
  2. It uses ActiveX calls to work Excel

Our company refuses to install Excel on "test machines". Only desktop user workstations get MS Office installed as they have to pay for each installation. Our test machines get Open Office installed on them.

 

I have had problems with LabView using ActiveX usually some strange error that even NI can not figure out due to difference's in the development system and target system.

-------------------------------------------------------------------
Unfortunately, most readers of this Forum, including some real Experts, have not mastered the skill of being able to read the code that Posters fail to post. If we cannot see "what you did wrong", we are unable to tell you how to fix it. (Bob Schor 28 August 2018)
0 Kudos
Message 15 of 20
(1,531 Views)

Thank you all For your Help.. I was satisfied..



Thank you & Best regards
syrpimp

=======================================================
“You must continue to gain expertise, but avoid thinking like an expert." -Denis Waitley
0 Kudos
Message 16 of 20
(1,500 Views)

@RTSLVU wrote:

One more thing, I have the Office/Excel tool kit in my LabView, there are a couple reason's we do not use it.

  1. It requires Excel to be installed on the target machine.
  2. It uses ActiveX calls to work Excel

Our company refuses to install Excel on "test machines". Only desktop user workstations get MS Office installed as they have to pay for each installation. Our test machines get Open Office installed on them.

 

I have had problems with LabView using ActiveX usually some strange error that even NI can not figure out due to difference's in the development system and target system.


The Write Measurements file option mentioned earlier doesn't use ActiveX or Excel to make XLSX files, and neither does XLR8.  If your managers want Excel files, then your managers want Excel.  Ignorance on their part shouldn't drive design on your part.

0 Kudos
Message 17 of 20
(1,488 Views)

@Hooovahh wrote:

The Write Measurements file option mentioned earlier doesn't use ActiveX or Excel to make XLSX files, and neither does XLR8.  


 

I understand the Write Measurement file option, that is what I used to use until I wrote a vi to write data to files exactly how I want.

 


Hooovahh wrote:XLR8.  If your managers want Excel files, then your managers want Excel.  Ignorance on their part shouldn't drive design on your part.

Yeah in a perfect world you are right, but in a corporate bureaucracy you do what you have to do to get your job done. 

-------------------------------------------------------------------
Unfortunately, most readers of this Forum, including some real Experts, have not mastered the skill of being able to read the code that Posters fail to post. If we cannot see "what you did wrong", we are unable to tell you how to fix it. (Bob Schor 28 August 2018)
0 Kudos
Message 18 of 20
(1,484 Views)

@RTSLVU wrote:

in a corporate bureaucracy you do what you have to do to get your job done. 


Yeah and some times that means telling the boss you are the expert, and know what is needed to do the task right.  But then again you don't want to be the guy that's not being a team player, not that that bothers me.

0 Kudos
Message 19 of 20
(1,466 Views)

@Hooovahh wrote:

@RTSLVU wrote:

in a corporate bureaucracy you do what you have to do to get your job done. 


Yeah and some times that means telling the boss you are the expert, and know what is needed to do the task right.  But then again you don't want to be the guy that's not being a team player, not that that bothers me.


Been there done that. Told my manager we need Excel on all the computers, made the request to IT, the IT manager came back with "No, due to the cost of MS Office it is now corporate policy that only user assigned desktops get MS Office. We will install Open Office on all lab and test computers".

 

They will not budge in this even if we offer to pay for each copy with our budget.

-------------------------------------------------------------------
Unfortunately, most readers of this Forum, including some real Experts, have not mastered the skill of being able to read the code that Posters fail to post. If we cannot see "what you did wrong", we are unable to tell you how to fix it. (Bob Schor 28 August 2018)
0 Kudos
Message 20 of 20
(1,461 Views)