rjplante
Well-known Member
- Joined
- Oct 31, 2008
- Messages
- 574
- Office Version
- 365
- Platform
- Windows
I have a workbook that uses a macro that launches another workbook and I want to refer to the previous workbook but do not know the name as it changes based on who saved it and what they named it. I have implemented the macro language below but it crashes at line 2 with the error: "Compile error: Sub or Function not defined." I have also removed the quotes around the File1 reference and get the same error. How can I get this to work?
File1 = ActiveWorkbook.Name
Workbook("File1").Activate
Thanks,
Robert
File1 = ActiveWorkbook.Name
Workbook("File1").Activate
Thanks,
Robert