LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Saving an Open excel file as a text file

I am trying to save an open excell file as a text file. I am using the invoke method SaveAs and do not know the parameters for FileFormat. I know to save as in regular excel format is (-4143). When I try to pop up on the Save As method and select Help for Save As it does not display anything. Where can I find a complete description for parameters needed for SaveAs
0 Kudos
Message 1 of 3
(3,791 Views)
Jim,
The SaveAs Invoke Node is an activeX method. Since this one is related to Excel, all help on the methods and properties for Excel is created by Microsoft. To be able to access help by right-clicking on methods and properties, you have to have Microsoft's VBA (Visual Basic for Applications) installed. It can be installed with the application you need help on, in your case Excel.
You can get all the FileFormat parameters for your Workbook with the FileFormat property node. Wire a property node to the output of Workbook open and the output is a Text Ring, so it displays the names and not numbers for different formats. You can select to view the Digital Display on this indicator, and it will show you the appropriate number. For example, -41 is -4143
is "xlWorkbookNormal". The "xlTextWindows" has number 20 associated with it.
The attached document has the help description that I got for SaveAs method and FileFormat property node. You may be able to get more information on these from the Microsoft's web site.

Zvezdana S.
National Instruments
Download All
0 Kudos
Message 2 of 3
(3,791 Views)
I had the same problem, and after quite a while trying to find an answer on the m$ support website, I decided to figure it out for myself. The problem is that with LabView we really need to know the integer numbers that correspond to the FileFormat variant type. Using the attached VI, I simply went through all the various file types that I can save a file as in Excel2000 and wrote down what the value was. Hopefully this VI and the text file with all the variant values will be helpful to you (I know it is to me!).

If anyone knows of a website/etc. that has descriptions for variant data types and values for other aspects of ActiveX methods/properties, please post it for us!
Download All
Message 3 of 3
(3,791 Views)