Invalid Procedure Call or Argument

Dundee Lad

Active Member
Joined
Sep 6, 2003
Messages
311
I have the following code

Private Sub CommandButton1_Click()
UserForm1.Show
End Sub

but when i run it i get the following error

Compile Error:

Invalid Procedure Call or Argument

this worked fine yesterday do you know how I fix this?
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)

Dundee Lad

Active Member
Joined
Sep 6, 2003
Messages
311
Sure, it is not userform initialize though. Someone on the board helped me with this

Private Sub UserForm_Activate()
Me.TextBox62.Text = Sheets("sheet3").Range("c4").Value
Me.TextBox61.Text = Sheets("sheet3").Range("d4").Value
Me.TextBox60.Text = Sheets("sheet3").Range("e4").Value
Me.TextBox59.Text = Sheets("sheet3").Range("f4").Value
Me.TextBox58.Text = Sheets("sheet3").Range("g4").Value
Me.TextBox57.Text = Sheets("sheet3").Range("h4").Value
Me.TextBox56.Text = Sheets("sheet3").Range("i4").Value
Me.TextBox55.Text = Sheets("sheet3").Range("j4").Value
Me.TextBox54.Text = Sheets("sheet3").Range("k4").Value
Me.TextBox53.Text = Sheets("sheet3").Range("l4").Value
Me.TextBox52.Text = Sheets("sheet3").Range("m4").Value
Me.TextBox51.Text = Sheets("sheet3").Range("n4").Value
Me.TextBox50.Text = Sheets("sheet3").Range("c5").Value
Me.TextBox49.Text = Sheets("sheet3").Range("d5").Value
Me.TextBox48.Text = Sheets("sheet3").Range("e5").Value
Me.TextBox47.Text = Sheets("sheet3").Range("f5").Value
Me.TextBox46.Text = Sheets("sheet3").Range("g5").Value
Me.TextBox45.Text = Sheets("sheet3").Range("h5").Value
Me.TextBox44.Text = Sheets("sheet3").Range("i5").Value
Me.TextBox43.Text = Sheets("sheet3").Range("j5").Value
Me.TextBox42.Text = Sheets("sheet3").Range("k5").Value
Me.TextBox41.Text = Sheets("sheet3").Range("l5").Value
Me.TextBox40.Text = Sheets("sheet3").Range("m5").Value
Me.TextBox39.Text = Sheets("sheet3").Range("n5").Value
Me.TextBox38.Text = Sheets("sheet3").Range("c6").Value
Me.TextBox37.Text = Sheets("sheet3").Range("d6").Value
Me.TextBox36.Text = Sheets("sheet3").Range("e6").Value
Me.TextBox35.Text = Sheets("sheet3").Range("f6").Value
Me.TextBox34.Text = Sheets("sheet3").Range("g6").Value
Me.TextBox33.Text = Sheets("sheet3").Range("h6").Value
Me.TextBox32.Text = Sheets("sheet3").Range("i6").Value
Me.TextBox31.Text = Sheets("sheet3").Range("j6").Value
Me.TextBox30.Text = Sheets("sheet3").Range("k6").Value
Me.TextBox29.Text = Sheets("sheet3").Range("l6").Value
Me.TextBox28.Text = Sheets("sheet3").Range("m6").Value
Me.TextBox27.Text = Sheets("sheet3").Range("n6").Value
End Sub
 

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,344
Office Version
  1. 365
Platform
  1. Windows
What makes you think it isn't a problem in the initialize code?:eek:

If it's not there then the only thing I can think of is that you've got a reference(s) problem.

To check that goto Tools>References...
 

Dundee Lad

Active Member
Joined
Sep 6, 2003
Messages
311
thanks for everyones help. I am failry new to VBA and userforms and have decided to move away from this solution for now until I understand it better.
 

Andresuru

New Member
Joined
Sep 6, 2021
Messages
33
Office Version
  1. 365
Platform
  1. Windows
Can you post your UserForm_Initialize code?

He is right Useform_initialize does not permit that userform shows correctly,

I had the same issue some minutes ago, basically I change Initialized for other event and then works perfectly.

Hope this helps
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,164,191
Messages
5,835,902
Members
430,393
Latest member
hetherton

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top