I have a number of UserForms into which I have added the "Call" command into the UserForm_Initialize() instruction. This has worked on all in my workbook except for the last one which returns the Error 91 message.
I have checked all the code and when the call command is run using the command button ('Call cmdCallRecords_Click deactivated as above) the form populates as expected.
However, whe the call line is activated as below, I get the error 91 message. The code does not contain any "With" blocks.
I cannot understand why this might be when this syntax works perfectlly fine for many other userforms in the workbook.
FYI There is no complex code just direct mapping from cells on a single worksheet to corresponding cells on the UserForm.
VBA Code:
Option Explicit
Dim ws As Worksheet
Private Sub userForm_Initialize()
'Call cmdCallRecords_Click
Set ws = Sheets("Draw Totals & Online Account")
End Sub
Private Sub cmdCallRecords_Click()
I have checked all the code and when the call command is run using the command button ('Call cmdCallRecords_Click deactivated as above) the form populates as expected.
However, whe the call line is activated as below, I get the error 91 message. The code does not contain any "With" blocks.
VBA Code:
Option Explicit
Dim ws As Worksheet
Private Sub userForm_Initialize()
Call cmdCallRecords_Click
Set ws = Sheets("Draw Totals & Online Account")
End Sub
Private Sub cmdCallRecords_Click()
I cannot understand why this might be when this syntax works perfectlly fine for many other userforms in the workbook.
FYI There is no complex code just direct mapping from cells on a single worksheet to corresponding cells on the UserForm.