424,301 Members | 1,295 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,301 IT Pros & Developers. It's quick & easy.

Convert the excel file as text file

P: 6
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"
Set wb = Workbooks.Open(txt1.Value)
Application.DisplayStatusBar = True
Application.StatusBar = "Loading..."
ActiveWorkbook.SaveAs Filename:=Application.GetSaveAsFilename(FileFilter :="Text Files (*.txt), *.txt", Title:="EmpMast"), FileFormat:=xlText, CreateBackup:=False
Application.StatusBar = False
MsgBox "CSV file has been created successfully", , "Success!!!"
Dim wbc As Workbook
Application.ScreenUpdating = False
For Each wbc In Workbooks
wb.Close savechanges:=True
Next wbc
End Sub
Jul 11 '18 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.