Excel VBA - TechRepublic
General discussion
July 1, 2001 at 03:11 AM
awebb2

Excel VBA

by awebb2 . Updated 25 years, 1 month ago

I have two wokbooks.

WB1.xls – contain a Userform named “Console”
WB2.xls

Both worksheet are open. In WB2 there is a command button with the following code:

Public Sub Back2Console_Click()

‘ refer to WB1 which was opened first
Workbooks(1).Activate

‘ Show UserForm
Console.Show

End Sub

On clicking the Command button in WB2, I am getting the following:

Run-time error ‘424’:
Object required

My intention is to get to the form (Console) in WB1. How can I fix this code?

This discussion is locked

All Comments