I have a workbook (workbook1.xlsm) that has a VB script that runs as soon as it opens. This VB script opens another workbook (workbook2.xlsm). As soon as workbook2.xlsm is opened, it copies everything from sheet1 and then goes back to workbook1.xlsm and pastes everything into sheet1. The final step of the script is that it closes workbook2.xlsm.
The problem is that workbook1.xlsm needs to be renamed and I still need the macro to run each time it opens. It all runs fine up until it needs to switch back to the workbook originally called workbook1.xlsm.
Is there a way to set a workbook name in the VB script so this will run regardless of the workbook name containing the macro that runs at startup?
The problem is that workbook1.xlsm needs to be renamed and I still need the macro to run each time it opens. It all runs fine up until it needs to switch back to the workbook originally called workbook1.xlsm.
Is there a way to set a workbook name in the VB script so this will run regardless of the workbook name containing the macro that runs at startup?
Last edited: