+ Reply to Thread
Results 1 to 3 of 3

Copy, edit and save workbook to same location as source data file, not macro file.

  1. #1
    Registered User
    Join Date
    03-05-2014
    Location
    Tampa, FL
    MS-Off Ver
    Excel 2010
    Posts
    28

    Copy, edit and save workbook to same location as source data file, not macro file.

    Having a fairly simple issue. Searching around isn't revealing the sort of short, simple solution I'm confident exists.

    I have my macros loaded into a workbook that is opened in the background. (this is the way it has to be for reasons beyond my control)

    I have a source data file. I need to make a copy of it, perform some macros to it, and then save that edited copy automatically back to the same folder the original file was opened from/located in. The copy is of course in a temp file, so then the save was dumping there. Then I tried the code below, but it seems to be saving to wherever the macro workbook is, not the original workbook. I presume there's either a variant of the 'ThisWorkbook.Path' command that I'm missing, or I need to log the original file location as a variable that is recalled later when saving, but I'm not savvy enough yet to know how to code that on my own. I'm lucky I understand that's a programming strategy at this point!

    Thank you in advance.

    Please Login or Register  to view this content.
    As you see, I have it set so that after the copied file is saved, it will close, which takes the user back to the original untouched file.
    Last edited by Jasonhouse; 04-01-2014 at 10:57 PM.

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: Copy, edit and save workbook to same location as source data file, not macro file.

    Hi, Jasonhouse,

    instead of
    Please Login or Register  to view this content.
    try
    Please Login or Register  to view this content.
    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  3. #3
    Registered User
    Join Date
    03-05-2014
    Location
    Tampa, FL
    MS-Off Ver
    Excel 2010
    Posts
    28

    Re: Copy, edit and save workbook to same location as source data file, not macro file.

    ok let me try that...

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 1
    Last Post: 09-05-2013, 02:39 PM
  2. Save as macro that specifies file type, file location and takes file name from three cells
    By ExcelFailure in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 06-13-2013, 10:09 PM
  3. [SOLVED] [Help]macro to open file browser, to select a location, and save the location to a cell
    By zhuleijia in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-06-2013, 09:56 AM
  4. Copy Sheet into New Workbook then Save File As Macro
    By larzep in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-23-2011, 02:57 AM
  5. Using Macro to Save Copy of File to New Location
    By Chris Z in forum Excel General
    Replies: 1
    Last Post: 07-05-2006, 12:20 PM

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