Results 1 to 5 of 5
  1. #1
    2 Star Lounger
    Join Date
    Oct 2001
    Location
    Not in KC anymore
    Posts
    192
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Save copy of workbook (2007)

    Hello all,

    I'm trying to save an exact workbook to a central location and can't seem to figure out this simple function.

    Here is the latest code I've tried:

    ActiveWorkbook.SaveAs "sharedFeb09" & ThisWorkbook.Name

    When running it, I get an error saying I can't have two workbooks open with the same name.

    I tried another approach and the workbook ended up being named "False". (I've since changed the code that produced that result, and therefore don't remember it)

    Any help is much appreciated.

    Thanks!

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Save copy of workbook (2007)

    I don't understand why you'd get that error message (but I don't have Excel 2007).

    Does it make a difference if you use SaveCopyAs instead if SaveAs?

  3. #3
    2 Star Lounger
    Join Date
    Oct 2001
    Location
    Not in KC anymore
    Posts
    192
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Save copy of workbook (2007)

    I just tried SaveCopyAs and it saved a copy of my personal workbook. I don't need that copied. Just the active sheet.

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Save copy of workbook (2007)

    If your code is in your personal macro workbook, ThisWorkbook will refer to that instead of to the active workbook. Replace ThisWorkbook with ActiveWorkbook in your code (and use SaveAs again).

  5. #5
    2 Star Lounger
    Join Date
    Oct 2001
    Location
    Not in KC anymore
    Posts
    192
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Save copy of workbook (2007)

    That did it.

    Thanks!

Posting Permissions

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