Converting an Excel file to Tab Delimited Format

This code will convert an Excel file to tab delimited format, using the Excel object model (which will require Excel to be installed where this code is run!).

Dim lobjExcel As Object  ' Instance Of The Excel Application Object
Dim lobjWorkBook As Object         'Instance For WorkBook Collection
Set lobjExcel = server.CreateObject("Excel.Application")
Set lobjWorkBook = lobjExcel.Workbooks.Open(Filename with the path)
lobjExcel.DisplayAlerts = False
'Saving In The Tab Delimited Format
lobjWorkBook.SaveAs lstrFilePath, -4158
lobjWorkBook.Close
Set lobjWorkBook = Nothing
'DesTroying The Excel Object
lobjExcel.Quit
lobjExcel = Nothing

You might also like...

Comments

Vipin Mohandas

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“The trouble with programmers is that you can never tell what a programmer is doing until it's too late.” - Seymour Cray