Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Converting file formats

I'm programing in visual basic.net and I need to convert
a excel spred sheet file into a text file(tab delimited)
and back again. Does anyone know how I could do this. I
assume there is a class that will make it easy but I
can't seem to find it. Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Converting file formats

If you have room/time to save the file during the macro
you could do it like this:

Private Sub ToTextNBackAgain()
ActiveWorkbook.SaveAs Filename:= _
"C:\ExcelFileAtStart.txt", FileFormat:= _
xlText, CreateBackup:=False
'at this point the file has been converted to text
ActiveWorkbook.SaveAs Filename:= _
"C:\ExcelFileAtStart.xls", FileFormat:= _
xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
'at this point the file has been converted back to an Excel
End Sub

-IA

-----Original Message-----
I'm programing in visual basic.net and I need to convert
a excel spred sheet file into a text file(tab delimited)
and back again. Does anyone know how I could do this. I
assume there is a class that will make it easy but I
can't seem to find it. Thanks.
.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Converting file formats

Ryan,

When you are in Visual Studio .Net open your project then goto
ProjectAdd Reference. Then click on the COM tab. Scroll do to
Microsoft Excel (version number) Object Library and click on it to
highlight it. Then click on the Select button. Then click the Ok
button.

The Excel object module will now be available to you in Visual
Studio. You should be able to now manipulate Excel from Visual Basic.


---
Message posted from http://www.ExcelForum.com/

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
converting excel 2003 to 2007 file formats XX23 Excel Discussion (Misc queries) 18 October 27th 09 05:44 PM
Converting date formats Diana G. Excel Discussion (Misc queries) 3 March 14th 07 09:29 PM
Converting file formats into .xls files Shawna Excel Discussion (Misc queries) 2 January 18th 07 07:45 PM
Help with converting date formats k3639 Excel Worksheet Functions 7 July 27th 06 11:21 PM
Converting date formats arem Excel Discussion (Misc queries) 2 February 14th 06 03:48 PM


All times are GMT +1. The time now is 06:02 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"