Command Button to Macro in Contact Script Code

lms

Joined
Aug 7, 2013
Messages
2
Reaction score
0
I found these two different ways to have a commandbutton in a contact form run a code from the script that runs a macro from a module in the VBA area. And the words macroname is the name of the macro and the module7 is the module number the macro is in

sub CommandButton6_click
call module7.macroname()
end sub

and there is error "object module7 required"

and then I did:

sub CommandButton6_click
macroname
end sub

and the errror is "type mismatch macroname"

Any way to fix this so I add a command button to a contact form script and it runs the the macro the script refers to as I need this very heavily!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top