Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2003
    Location
    france
    Posts
    1

    Unanswered: ActiveWorkbook.SaveAs

    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
    Last edited by sparta58; 09-26-03 at 09:18.

  2. #2
    Join Date
    Sep 2003
    Location
    Cincinnati, Oh USA
    Posts
    203

    Re: ActiveWorkbook.SaveAs

    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
    --------------------------

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •