Hello Friends,
I have a Excel file and i need to write a macro to export 1st column fields to a text file in which all the field elements are seperated by coma..could u pl suggest me how to do that, sample code will be helpful
Thanks
Printable View
Hello Friends,
I have a Excel file and i need to write a macro to export 1st column fields to a text file in which all the field elements are seperated by coma..could u pl suggest me how to do that, sample code will be helpful
Thanks
I made a quick search in this forum. Here are two links that might help u:
http://www.vbforums.com/showthread.p...le+export+text
http://www.vbforums.com/showthread.p...l+to+text+file
Hello, this is not helping me, could u pl provide the code, what i need to do is copy certain range excel file and paste them in a text file seperated by comas, if i can write a macro that will be very helpful
Thanks
Copy the range of data you want to save to a new sheet then use the below.
Code:'Save as a text file
objExcel.ActiveWorkbook.SaveAs FileName:=C:\Test.txt, FileFormat:=xlText
Using this i am getting object failed error and i do not have help, could u give me the exact code please, thx
This is to open the spreadsheet.
and this is now to save as a txt file.Code:Dim oXLApp As Object
Dim objExcel As Object
Set objExcel = CreateObject("Excel.Application")
Set oXLApp = objExcel.Workbooks.Open(FileName:=C:\Book1.xls)
objExcel.Visible = False 'show excel or not
objExcel.DisplayAlerts = False
objExcel.WorkSheets("Sheet1").Select ' Select sheet to work with
HTH :)Code:objExcel.ActiveWorkbook.SaveAs FileName:=C:\Test.txt, FileFormat:=xlText