Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 52
Default Connecting Modules in VBA

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?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Connecting Modules in VBA

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?



  #3   Report Post  
Posted to microsoft.public.excel.programming
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?




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Connecting Modules in VBA

Hi Jenny,

Try:
'==============
Sub CommandButton1_Click()
CommandButton1.Caption = "refresh critical ratio table"
Call ValueSearch
End Sub
'<<==============


---
Regards,
Norman


"Jenny" wrote in message
...
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?






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 52
Default Connecting Modules in VBA

Hi again,
So, I am definitely getting closer, but now the sub function is not defined,
specifically valuesearch. How can I define it?

Jenny

"Norman Jones" wrote:

Hi Jenny,

Try:
'==============
Sub CommandButton1_Click()
CommandButton1.Caption = "refresh critical ratio table"
Call ValueSearch
End Sub
'<<==============


---
Regards,
Norman


"Jenny" wrote in message
...
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?








  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Connecting Modules in VBA

Hi Jenny,

(1) Check that the macro name is spelled correctly.
(2) Is the macro in a standard module in the same workbook as the
command button?
(3) Where is the command button code?


---
Regards,
Norman


"Jenny" wrote in message
...
Hi again,
So, I am definitely getting closer, but now the sub function is not
defined,
specifically valuesearch. How can I define it?

Jenny

"Norman Jones" wrote:

Hi Jenny,

Try:
'==============
Sub CommandButton1_Click()
CommandButton1.Caption = "refresh critical ratio table"
Call ValueSearch
End Sub
'<<==============


---
Regards,
Norman


"Jenny" wrote in message
...
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?








Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Public, Private, Event modules, Forms modules,,, Jim May Excel Programming 11 October 31st 05 03:12 AM
Basic question - modules and class modules - what's the difference? Mark Stephens[_3_] Excel Programming 9 May 8th 05 11:48 AM
When to code in sheet or userform modules and when to use modules Tony James Excel Programming 1 December 16th 04 10:02 PM
Need Help Connecting To DB J.Adams Excel Programming 3 May 31st 04 06:34 PM
Class Modules vs Modules Jeff Marshall Excel Programming 2 September 28th 03 07:57 PM


All times are GMT +1. The time now is 02:15 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"