View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
jenny jenny is offline
external usenet poster
 
Posts: 52
Default Connecting Modules in VBA

Hi,
So, this is my button code, I keep getting error 9 on the 4th line:

Sub CommandButton1_Click()
Dim button1 As Module
Set button1 = Modules!["calc"]
CommandButton1.Caption = "refresh critical ratio table"
button1
End Sub

"calc" is the name of the module I need to access, within that module is a
sub procedure called "valuesearch" that needs to run on command.

Thanks!
"Norman Jones" wrote:

Hi Jenny,

Try posting your button code and, possibly, the function.

---
Regards,
Norman



"Jenny" wrote in message
...
I have 3 worksheets, 1 is results, 1 is calculation, and the 3rd is the
data
input interface. On the third I have buttons that need to execute and
update
field command. I can't get the button to work, when I run the program in
VBA
it can't find the function I am trying to call because it is a different
module. I've tried sharing it, and making it public.... any ideas?