Convert the excel file as text file

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • 681212
    New Member
    • Jun 2018
    • 6

    Convert the excel file as text file

    With the below code, I could able to save the excel file as Text file. But in the text file so generated, there will be "#####" marks after each row. Please let me know how to get rid of this..

    Private Sub cmdtxt_Click()
    Dim wb As Workbook
    If txt1.Value = "" Then
    MsgBox "Please browse the file first!", vbOKOnly, "Error"
    cmdbrowse.SetFo cus
    Else
    Set wb = Workbooks.Open( txt1.Value)
    Application.Dis playStatusBar = True
    Application.Sta tusBar = "Loading... "
    ActiveWorkbook. SaveAs Filename:=Appli cation.GetSaveA sFilename(FileF ilter:="Text Files (*.txt), *.txt", Title:="EmpMast "), FileFormat:=xlT ext, CreateBackup:=F alse
    Application.Sta tusBar = False
    MsgBox "CSV file has been created successfully", , "Success!!! "
    Dim wbc As Workbook
    Application.Scr eenUpdating = False
    For Each wbc In Workbooks
    wb.Close savechanges:=Tr ue
    Next wbc
    Application.Qui t
    End Sub
Working...