Oseitutuakrasi
New Member
- Joined
- Jun 7, 2023
- Messages
- 38
- Office Version
- 365
- Platform
- Windows
I am trying to open a series of workbooks one at a time from command buttons. In each workbook I have a button on a form. For example, when I click the button on UserForm1 in WORKBOOK1, I open workbook2 and then close workbook1 in the process. Then in workbook2, I click a button and open workbook3, then close workbook2 etc. etc. Unfortunately, the previous workbooks don't close so I have all the workbooks open.
On the other hand, if I manage to close the previous workbook, then the UserForm in the current workbook is not displayed. For example if I open workbook2 from workbook1 and then manage to close workbook1, the userform in workbook2 is not shown, so I cannot click any button to open the next workbook. I have only one form in each workbook, and I use Workbook_Open() to show the form as the workbook is being open
(UserformX.Show). It appears that if I open Workbook2 from workbook1 and the close workbook1, workbook2's Open event is not executed. But if I DONT CLOSE workbook1, workbook2' Open event runs. I am using VBA for all this. If I am making sense, can someone help me please?
Good Day
On the other hand, if I manage to close the previous workbook, then the UserForm in the current workbook is not displayed. For example if I open workbook2 from workbook1 and then manage to close workbook1, the userform in workbook2 is not shown, so I cannot click any button to open the next workbook. I have only one form in each workbook, and I use Workbook_Open() to show the form as the workbook is being open
(UserformX.Show). It appears that if I open Workbook2 from workbook1 and the close workbook1, workbook2's Open event is not executed. But if I DONT CLOSE workbook1, workbook2' Open event runs. I am using VBA for all this. If I am making sense, can someone help me please?
Good Day