01-20-2010 07:51 AM
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 ......
Solved! Go to Solution.
01-20-2010 08:00 AM
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.
01-20-2010 08:06 AM - last edited on 06-05-2024 03:56 PM by Content Cleaner
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
01-20-2010 09:25 AM
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.
01-21-2010 12:16 AM - edited 01-21-2010 12:21 AM
01-21-2010 03:25 AM
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
01-21-2010 04:45 AM
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 !
01-21-2010 05:04 AM
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
01-22-2010 12:57 AM - edited 01-22-2010 01:00 AM
I could save .xls as .csv using activeX ........
Problem was solved ....
Thanks my freind
But what is VB Macro Editor ??
01-22-2010 04:30 AM
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