excel cel format

sek

Member
Joined
Jul 2, 2009
Messages
10
Programming Experience
Beginner
Hi,

I want to change the format of the excel file to Text.how to do this???

thanks in advance.
 
"cel format" ?? Csv would be the most common tabular plain text format..

You can use the Office automation libraries (add reference to Excel Object Library, COM page):
VB.NET:
'Imports Excel = Microsoft.Office.Interop.Excel

Dim loadpath As String = IO.Path.Combine(Application.StartupPath, "file.xls")
Dim savepath As String = IO.Path.Combine(Application.StartupPath, "file.csv")

Dim app As New Excel.Application
app.DisplayAlerts = False
Dim book As Excel.Workbook = app.Workbooks.Open(loadpath)
book.SaveAs(savepath, Excel.XlFileFormat.xlCSVWindows)
book.Close()
app.Quit()
You can also load Excel data with ADO.Net (OleDB), then save it out with a StreamWriter or just WriteXml.
 
Back
Top