LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Saving .XLS file as .CSV format using LabVIEW & ActiveX

Solved!
Go to solution

Hi every body ...
I want to write a program that get a path of a excel file(*.xls) and save it at the same path in .csv format.(using activeX)
Is it possible?
I dont know many things about ActiveX and variant data types.
Please help me ......

0 Kudos
Message 1 of 12
(8,064 Views)

Hello Mostafi,

 

You can read your data from the excel file using "report generation" to an array. Then you can save it as *.csv using "write to spreadsheet file" (you can select the separator.

 

If you don't know how to use "report generation" (this uses activex), install it and see the examples. It's simple.

Software developer
www.mcm-electronics.com





PORTUGAL
Message 2 of 12
(8,058 Views)

It is posible.

 

You might want to talke a look at the Report Generation Toolkit .  This has all the active X calls built in you don't have to make them from scratch.

 

I have in the past saved  CSV formated text with an .xls extention using LabVIEW and it worked.   I don't know how your excel file is formated but if it is already in a csv format you just need to change the extension from .xls to .csv

Dan Shangraw, P.E.


   

Message 3 of 12
(8,055 Views)

mostafi wrote:

Hi every body ...
I want to write a program that get a path of a excel file(*.xls) and save it at the same path in .csv format.(using activeX)
Is it possible?
I dont know many things about ActiveX and variant data types.
Please help me ......


Do you know about searching? This question comes up several times a month, and several examples have been posted on reading Excel workbooks with ActiveX. Attached is one example that I myself wrote and posted several times.

Message 4 of 12
(8,041 Views)
Hi freinds ...
Thanks for answers ....
Mr or Miss "smercurio_fc" I don't know the amount of rows in my excel files. but I want read all of them. (There are 6 column and there are variable values of rows in each file)
In other word I don't know amount of "end cell" control in your program.....

I don't want read .xls file using activeX. I want save a .xls as a .csv format.
Look at this program :
http://rapidshare.com/files/338627491/EXCEL_TEST_EXPRESS.rar.html

in this program I used "Read From Measurement File Express VI" and "Convert from Dynamic Data" to access each column.
"Read From Measurement File" is a very useful tool.Also "Convert from Dynamic Data" is. But "Read From Measurement File" does not work with .xls file and only accept .lvm file (or a .csv file that rename it to .lvm)
Also I try to save a .xls file as .csv format using ActiveX and Invoke Node( "saveasformat" methode). But it not successful .... 
Please Help .........

I have Report Generation Toolkit 30 days trial. which VI of this toolkit must be used?
Excuse me for my poor english!
Message Edited by mostafi on 01-21-2010 12:21 AM
0 Kudos
Message 5 of 12
(8,029 Views)

You can use ActiveX without the toolkit. The Excel ActiveX interface even offers you a methode to directly save it as csv, so it should be as simple as Open Automation Refnum, Load xls File, Save csv File, Close Automation Refnum.

 

Felix 

0 Kudos
Message 6 of 12
(8,016 Views)

Hi F. Schubert 
Can you help me more ?
For example which method can do this ?
Which Refnum ? Excel_Application ? Excel_Workbook ? or Excel Worksheet ? ....
Please give me the VI program ! 

0 Kudos
Message 7 of 12
(8,004 Views)
Solution
Accepted by topic author mostafanfs

I only have that from memory, you need to find the correct methods on your own and using the Excel Programming Help (you will find that from the VB macro editor).

I guess that _Application is providing you a method to Open an existing workbook and return the _Workbook reference. There is a SaveCSV method either for the WB or the App, try yourself.

 

Felix 

Message 8 of 12
(8,000 Views)

I could save .xls as .csv using activeX ........ 

Problem was solved .... 

Thanks my freind 

 But what is VB Macro Editor ??

Message Edited by mostafi on 01-22-2010 01:00 AM
0 Kudos
Message 9 of 12
(7,973 Views)

In Excel you can go to

Tools -> Macro -> Visual Basic Editor

This is not installed by default, if you don't have it, you will need the installation CD to install it.

There you find a reference of all Excel ActiveX stuff under Help. But it is just an reference of that vast Object composition, so it takes some days to get used to it...

 

Felix 

0 Kudos
Message 10 of 12
(7,952 Views)