+ Reply to Thread
Results 1 to 6 of 6

Macro to save a workbook that it is NOT IN

  1. #1
    Registered User
    Join Date
    07-31-2012
    Location
    Somewhere, Indiana
    MS-Off Ver
    Excel 2010
    Posts
    19

    Macro to save a workbook that it is NOT IN

    Hey Excel gurus,

    I'm trying to make a macro that will be in a empty workbook. I want the macro to save a whole different workbook. Unforunately, i'm really new to this and only know the activeworkbook and this workbook commands. Here is the path of the workbook that I want saved S:\Production\C9\C9 Coat weight data . Also I want the macro to run automatically when the empty workbook is opened b/c I will have a windows scheduled task opening it every 7 days. Basically my whole object is to save the workbook at S:\Production\C9\C9 Coat weight data every 7 days.



    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    01-12-2007
    Location
    New Jersey
    Posts
    2,127

    Re: Macro to save a workbook that it is NOT IN

    I presume there is a workbook that is essentially the template, and Windows Scheduler will open this template workbook. If that's the case, your code should work fine, but the code should be moved into the Workbook module. In order to do this, insert a module and use the Subroutine name Auto_Open. Try this and let me know if it works.

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    07-31-2012
    Location
    Somewhere, Indiana
    MS-Off Ver
    Excel 2010
    Posts
    19

    Re: Macro to save a workbook that it is NOT IN

    Right, windows scheduler will open the empty workbook. However, the file I want to save is not that workbook so "Active Workbook" shouldn't work. Especially since the file will not necessarily be open.

    ---------- Post added at 01:31 PM ---------- Previous post was at 01:26 PM ----------

    I don't want to put the module in the actual workbook I want to save b/c I don't want that work book saving everytime somone opens it.

  4. #4
    Forum Expert
    Join Date
    01-12-2007
    Location
    New Jersey
    Posts
    2,127

    Re: Macro to save a workbook that it is NOT IN

    Understood. Your code will look similar to the following (make changes as needed)

    Please Login or Register  to view this content.
    Does this help? Are you able to translate it to your workbook? (Obviously, in my code replace the path with the path of your workbook)

  5. #5
    Registered User
    Join Date
    07-31-2012
    Location
    Somewhere, Indiana
    MS-Off Ver
    Excel 2010
    Posts
    19

    Re: Macro to save a workbook that it is NOT IN

    Thanks a lot! This is exactly what I needed, I'll mark my post Solved.

  6. #6
    Forum Expert
    Join Date
    01-12-2007
    Location
    New Jersey
    Posts
    2,127

    Re: Macro to save a workbook that it is NOT IN

    AWesome. Glad it worked.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1