Message Box Troubles

Yeoman.jeremy

Board Regular
Joined
Apr 4, 2011
Messages
90
Hi there.
I Tried creating a message box using vba, and nothing is working.
I've looked through all the guide sites and nothing is working for me.

I'm writing
Code:
Sub MsgBox_mcr()
MsgBox "Test is complete."
End Sub
for example, and when i run the macro
it says

"Compile Error,
Wrong number of arguements or invalid property assignment."
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Something is going on other than that macro because it runs fine for me. Maybe you have other code you are not posting, including exactly how you call that macro. Try posting all your code and / or explaining exactly what it is you are doing. The answer lies beyond what you've provided.
 
Upvote 0
Code:
Sub CustomerFeedbackMsgBox()
MsgBox "You have not recorded how the customer heard of this store. Please do so before completing this form."
End Sub

This is it.

I want to run this macro from another macro, but before i can even do that it has to work.

Whenever i try to step through this, or click the play button in my vb editor it comes up with the error message as above
 
Upvote 0
That second macro works OK too. Maybe you have a stray character or line of code elsewhere in a module.
 
Upvote 0
Did you press Enter after "Please do so"?
 
Upvote 0
Have you got a procedure called MsgBox that you wrote yourself? Perhaps the procedure that's calling CustomerFeedbackMsgBox?
 
Upvote 0
I looked back through my other modules, and discovered a couple of unfinished MsgBox modules lying around

Just got rid of those and it works fine now.
Interesting.

Thanks all
 
Upvote 0
Very unwise to give modules the same name as existing VBA functions. It confuses the hell out of VBA!
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,280
Members
452,902
Latest member
Knuddeluff

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
Back
Top