PDA

View Full Version : ActiveWorkbook.SaveAs


sparta58
09-25-03, 19:19
i try to export an excel sheet in a txt file format. every thing works ok except if i have a , in a range then it create a " before and after the line
help me please !! and do not creat it with a .

"aaaaaa|2222,22|rrrrr"
aaaaaa|2222.22|rrrrr"

i am using this code

ActiveWorkbook.SaveAs Filename:= _
"F:\macro\modelef.txt", _
FileFormat:=xlText, _
CreateBackup:=False

thanks Alain
Paris

RickKnight
09-30-03, 16:12
Try this:

cmdSaveTXT_Click()
Dim S as WorkSheet
Dim fName
fName = ?? (get a file name you want from a textbox or cell)
Dim strPath as String
With Application
.ScreenUpDating = False
.DisplayAlerts = False
End With
strPath = "C:\YourFolder\"
For Each S In ActiveWorkbook.Worksheets
S.SaveAs strPath & fName, xlText
Next S
Set S = Nothing
End Sub






---------------------------
i try to export an excel sheet in a txt file format. every thing works ok except if i have a , in a range then it create a " before and after the line
help me please !! and do not creat it with a .

"aaaaaa|2222,22|rrrrr"
aaaaaa|2222.22|rrrrr"

i am using this code

ActiveWorkbook.SaveAs Filename:= _
"F:\macro\modelef.txt", _
FileFormat:=xlText, _
CreateBackup:=False

thanks Alain
--------------------------