largeselection
Active Member
- Joined
- Aug 4, 2008
- Messages
- 358
Hi,
So I have some code and Userform1 tracks the progress of that code. As part of the code it closes the workbook, waits 15 seconds, then re-opens the workbook and finishes the code. I have tried many combinations to try and have a second userform open as part of the code, but I keep getting "activeX can't create object" errors. Currently the set up is like this:
Main Code:
Userform1 Code:
Resume Code:
Userform2 Code:
Everything works correctly until UserForm2.Show. So the userform appears and adjust as necessary, the workbook closes, and it reopens correctly, but then I get the activeX can't create object error at the Userform2.Show. Any ideas on how I need to adjust it to get it working?
So I have some code and Userform1 tracks the progress of that code. As part of the code it closes the workbook, waits 15 seconds, then re-opens the workbook and finishes the code. I have tried many combinations to try and have a second userform open as part of the code, but I keep getting "activeX can't create object" errors. Currently the set up is like this:
Main Code:
Code:
Userform1.Show False
Userform1 Code:
Code:
PrivateSub Userform1_Activate()
Code
Code
Code
Unload Me
Exit Sub
PrivateSub Userform1_QueryClose()
Application.OnTime Now + TimeValue("00:00:20"), "ResumeCode"
ThisWorkbook.Close
End Sub
Resume Code:
Code:
ThisWorkbook.Activate
UserForm2.Show False
Userform2 Code:
Code:
PrivateSub Userform2_Activate()
Code
Code
Everything works correctly until UserForm2.Show. So the userform appears and adjust as necessary, the workbook closes, and it reopens correctly, but then I get the activeX can't create object error at the Userform2.Show. Any ideas on how I need to adjust it to get it working?