Results 1 to 4 of 4

Thread: save as (2003)

  1. #1
    2 Star Lounger
    Join Date
    Jan 2004
    Posts
    196
    Thanks
    1
    Thanked 0 Times in 0 Posts

    save as (2003)

    My question is in requards to the following:

    ActiveWorkbook.SaveAs Filename:=ActiveWorkbook.FullName, FileFormat:=xlNormal

    How might I go about adding some text to the existing file name?
    Example--> current file name: test.xls
    Want to saveAs with file name: testORG.xls
    Keep in mind that the current file name 'test' will vary from file to file.

    Thanks,
    Jackal

  2. #2
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: save as (2003)

    How about:

    <pre>Dim strFN As String
    strFN = Left(ActiveWorkbook.FullName, Len(ActiveWorkbook.FullName) - 4) & "ORG"
    ActiveWorkbook.SaveAs Filename:=strFN, FileFormat:=xlNormal
    </pre>

    Legare Coleman

  3. #3
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: save as (2003)

    Dim sName As String
    Dim sAdd As String
    sAdd = "ORG"
    sName = ActiveWorkbook.FullName
    sName = Application.WorksheetFunction.Substitute( _
    sName, ".xls", sAdd & ".xls")
    ActiveWorkbook.SaveAs FileName:=sName, FileFormat:=xlNormal

    Steve

  4. #4
    2 Star Lounger
    Join Date
    Jan 2004
    Posts
    196
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: save as (2003)

    Steve & Legare,

    Thank you both ! !

    Jackal

Posting Permissions

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