none
Workbooks linked together after copy RRS feed

  • Question

  • I have several macros in a workbook I called "testing". After making sure they worked properly I copied them to the "production" workbook. Now I can't run the macros in the "production" workbook without having the "testing" workbook available (same folder). How can I disconnect these workbooks and what did I do to make this happen so I can be sure not to repeat it later.
    Wednesday, February 10, 2016 8:55 AM

Answers

  • >>>I wasn't very clear about what happens. When I execute the macro in the "production" workbook the "testing" workbook opens and the macro runs fine. If I move the "testing" workbook out of the folder then the macro fails stating it couldn't find file "c:\..\testing.xlsm".

    According to your description, I have made a sample to try to reproduce this issue, unfortunately, I can't. So I suggest that you could set one breakpoint to debug Macro.

    For more information, click here to refer about Copy a macro module to another workbook

    In addition could you provide more information about your issue, for example sample file, sample code, screenshot etc., that will help us reproduce and resolve it.

    Thanks for your understanding.

    • Marked as answer by David_JunFeng Thursday, February 18, 2016 2:33 PM
    Thursday, February 11, 2016 1:59 AM

All replies

  • Did you copy the macro code from one workbook to another? or just copy a command button that executes it?

    Also if you do a search of your code in the production workbook do you find "Test" in there?

    D

    Wednesday, February 10, 2016 9:54 AM
  • I did a search and don't see either name in the code. It was a copy of the module within the VBA editor. With both workbooks opened, I dragged the modules from one to the other in the project explorer panel.
    Wednesday, February 10, 2016 11:41 AM
  • when you close the test one can you see where the code fails- while I haven't transferred the code as you have- just tested it and worked fine.- where it fails and message would be helpful

    Is there some piece of code on the actual spreadsheet that links back?

    D

    Wednesday, February 10, 2016 11:51 AM
  • I wasn't very clear about what happens. When I execute the macro in the "production" workbook the "testing" workbook opens and the macro runs fine. If I move the "testing" workbook out of the folder then the macro fails stating it couldn't find file "c:\..\testing.xlsm".

    Wednesday, February 10, 2016 12:40 PM
  • Well you certainly have a link back to that workbook

    you could try edit find for 

    [testing.xlsm]

    keeping the brackets- this hopefully will show you were your link is (the problem probably isn't your Vb code but code on the spreadsheet

    also in  data connection edit links it should tell you where you might have links back to testing.xlsm

    HTH

    D

    Wednesday, February 10, 2016 2:44 PM
  • >>>I wasn't very clear about what happens. When I execute the macro in the "production" workbook the "testing" workbook opens and the macro runs fine. If I move the "testing" workbook out of the folder then the macro fails stating it couldn't find file "c:\..\testing.xlsm".

    According to your description, I have made a sample to try to reproduce this issue, unfortunately, I can't. So I suggest that you could set one breakpoint to debug Macro.

    For more information, click here to refer about Copy a macro module to another workbook

    In addition could you provide more information about your issue, for example sample file, sample code, screenshot etc., that will help us reproduce and resolve it.

    Thanks for your understanding.

    • Marked as answer by David_JunFeng Thursday, February 18, 2016 2:33 PM
    Thursday, February 11, 2016 1:59 AM