Click here for important information about

export data from excel to text file by batch

Microsoft Windows xp home edition sp2b
April 9, 2010 at 01:13:35
Specs: Windows XP
Dear all,

could you show me plz how to create a batch file can
export data from excel to text file and save this text file in (C:\) drive

plz i need your help

See More: export data from excel to text file by batch

April 9, 2010 at 01:25:30
Post this in the Programming Forum here:

Home Page

Report •

April 9, 2010 at 01:38:28

sorry man i'm new in this forum


Report •

April 9, 2010 at 01:41:07

hi Ewen

when i'm try to post my problem in your link

i get this this message

ERROR: Posting on multiple forums
Posting on multiple forums may result in all posts being removed!

Please only post your message on one forum. No reason should exist that your question must be asked on more than one forum.

plz help what i can do

Report •

Related Solutions

April 11, 2010 at 15:27:25

Here is a short macro that creates a text file from Excel data.

Sub Export()
Dim objFs As Object
Dim objText As Object
Dim strData As String
Dim n As Integer

Set objFs = CreateObject("Scripting.FileSystemObject")

'create the text file with Path & text filename
Set objText = objFs.CreateTextFile("C:\MyExcelData.txt", 1)

'create a string from the data
For n = 0 To 20
    strData = strData & ActiveSheet.Range("B2").Offset(n, 0).Text & vbCrLf
Next n

'write the string to the text file
objText.WriteLine (strData)

'close the text file

'remove the file system object
Set objFs = Nothing
End Sub

It includes a loop to collect data from cells in a column starting at cell B2, using an offset to move through a range.
There are lots of ways to collect the data, so you can modify the data capture to suit your needs and still use the basic file system.

Hope this helps.


Report •

Ask Question