+ Reply to Thread
Results 1 to 13 of 13

Save Copy Of Workbook & Keep Both Open (Original and copy)

  1. #1
    Forum Contributor
    Join Date
    09-10-2012
    Location
    Slovakia
    MS-Off Ver
    Excel 365
    Posts
    176

    Save Copy Of Workbook & Keep Both Open (Original and copy)

    Hello,

    I am using this macro code for creating copy of my Excel file. I would like to update this code and keep both files opened (original and also new copy), because I need to make some changes in newly copied file and after that save it again.

    Could you pls help me write down Action 1. & 3. in following code?

    Please Login or Register  to view this content.

  2. #2
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,937

    Re: Save Copy Of Workbook & Keep Both Open (Original and copy)

    Hi there

    Please Login or Register  to view this content.
    Try the code above
    ---
    Hans
    "IT" Always crosses your path!
    May the (vba) code be with you... if it isn't; start debugging!
    If you like my answer, Click the * below to say thank-you

  3. #3
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,937

    Re: Save Copy Of Workbook & Keep Both Open (Original and copy)

    You will have to close the file after you finish yourself

  4. #4
    Forum Contributor
    Join Date
    09-10-2012
    Location
    Slovakia
    MS-Off Ver
    Excel 365
    Posts
    176

    Re: Save Copy Of Workbook & Keep Both Open (Original and copy)

    Hi Keebellah,

    unfortunately, it doesn't work as I expected. You defined original workbook as source file and in next step you initiate its opening. However this file is always opened. What I need is to open created copy.

  5. #5
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,937

    Re: Save Copy Of Workbook & Keep Both Open (Original and copy)

    Sorry, saw you used savecopy as
    Well then this should work


    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    09-10-2012
    Location
    Slovakia
    MS-Off Ver
    Excel 365
    Posts
    176

    Re: Save Copy Of Workbook & Keep Both Open (Original and copy)

    Hmmm, looks better, however doesn't work due to:

    Run-time error '1004': Excell cannot open the file '641_CB_data_2017_10.xlsx' because the file format or file extension is not valid. Verify that the file has not been corrupted and that the file extension matches the format of the file.

  7. #7
    Forum Contributor
    Join Date
    09-10-2012
    Location
    Slovakia
    MS-Off Ver
    Excel 365
    Posts
    176

    Re: Save Copy Of Workbook & Keep Both Open (Original and copy)

    It looks, that your macro works perfectly, but problem is with created copy in this this part of macro. I am not able to open it manually too.

    Please Login or Register  to view this content.
    There is omitted File format:=52, because it didn't work and I didn't realize it before, that created copied is not active file.

  8. #8
    Forum Contributor
    Join Date
    09-10-2012
    Location
    Slovakia
    MS-Off Ver
    Excel 365
    Posts
    176

    Re: Save Copy Of Workbook & Keep Both Open (Original and copy)

    But in addition. Any possibility to update also following steps?

    '2, do some stuff in opened copied file - in this step I will use some additional macros
    '3, SAVE COPIED FILE AGAIN AND CLOSE IT - in this step I need assistance
    Last edited by Tapyr; 11-21-2017 at 12:40 PM.

  9. #9
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,937

    Re: Save Copy Of Workbook & Keep Both Open (Original and copy)

    Not possible. macro has stopped running

  10. #10
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,937

    Re: Save Copy Of Workbook & Keep Both Open (Original and copy)

    I think I found a way, I'll test and let you know.

  11. #11
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,937

    Re: Save Copy Of Workbook & Keep Both Open (Original and copy)

    Well, first you cannot use SaveCopyAs and chnage the fileformat from xlsm to xlsx. a Copy is a COPY
    I don't know why you want to use SaveCopyAs and not SaveAs.

    Then that file is opened and you can work on it and save it, or use my first idea when I had overlooked you SaveCopyAs .
    Do you really need the original once you have saved the file?

  12. #12
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,937

    Re: Save Copy Of Workbook & Keep Both Open (Original and copy)

    Here's some code that works

    Please Login or Register  to view this content.

  13. #13
    Forum Contributor
    Join Date
    09-10-2012
    Location
    Slovakia
    MS-Off Ver
    Excel 365
    Posts
    176

    Re: Save Copy Of Workbook & Keep Both Open (Original and copy)

    Thank you very much, my friend.
    Meantime I tried to write down more simple way and it looks, that it works.
    Please Login or Register  to view this content.

+ 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. Open, copy and save to password protected workbook
    By pjbassdc in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-27-2013, 11:46 AM
  2. Save file as copy while still having original still open
    By djblois1 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-12-2013, 03:40 PM
  3. Open Multiple Files, Copy Worksheet, Paste in to Specific Tab in Original Workbook
    By freybe06 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-30-2013, 10:27 AM
  4. Save copy as, open copy, alter copy, save copy and close copy
    By tradinup2 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-03-2013, 04:42 PM
  5. [SOLVED] Save workbook keep original open
    By mspeck in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-09-2012, 08:00 AM
  6. Open workbook, copy data, save and close error
    By Jessica.Bush in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-01-2012, 12:59 PM
  7. Open a template, copy 3 worksheets w ranges and save as workbook
    By gimme_this_gimme_that@yahoo.com in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-03-2006, 01:35 AM

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