Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
q q is offline
external usenet poster
 
Posts: 6
Default Undefined function

I have placed a command button on a spreadsheet (Sheet1). In the click
event I call a user defined, public function that I created and placed in
the ThisWorkbook module. When I click on the command button I get the
error: Sub or Function not defined.

The function is public and there are no spelling errors. What am I doing
wrong?

Thanks.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 222
Default Undefined function

Could you post an example of your code, perhaps?

"q" wrote:

I have placed a command button on a spreadsheet (Sheet1). In the click
event I call a user defined, public function that I created and placed in
the ThisWorkbook module. When I click on the command button I get the
error: Sub or Function not defined.

The function is public and there are no spelling errors. What am I doing
wrong?

Thanks.



  #3   Report Post  
Posted to microsoft.public.excel.programming
q q is offline
external usenet poster
 
Posts: 6
Default Undefined function

Sure. Here is the code. In the Sheet1 module I have this:
------------------------------------
Private Sub cmdStart_Click()
Dim bSuccess As Boolean

bSuccess = OpenMessageTable()

End Sub
-------------------------------------

In the ThisWorkbook module I have this:
---------------------------------------------------
Public Function OpenMessageTable() As Boolean

(code omitted)

End Function
----------------------------------------------


"bigwheel" wrote in message
...
Could you post an example of your code, perhaps?

"q" wrote:

I have placed a command button on a spreadsheet (Sheet1). In the click
event I call a user defined, public function that I created and placed in
the ThisWorkbook module. When I click on the command button I get the
error: Sub or Function not defined.

The function is public and there are no spelling errors. What am I doing
wrong?

Thanks.





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 222
Default Undefined function

Try adding a module and putting the Function code in that

"q" wrote:

Sure. Here is the code. In the Sheet1 module I have this:
------------------------------------
Private Sub cmdStart_Click()
Dim bSuccess As Boolean

bSuccess = OpenMessageTable()

End Sub
-------------------------------------

In the ThisWorkbook module I have this:
---------------------------------------------------
Public Function OpenMessageTable() As Boolean

(code omitted)

End Function
----------------------------------------------


"bigwheel" wrote in message
...
Could you post an example of your code, perhaps?

"q" wrote:

I have placed a command button on a spreadsheet (Sheet1). In the click
event I call a user defined, public function that I created and placed in
the ThisWorkbook module. When I click on the command button I get the
error: Sub or Function not defined.

The function is public and there are no spelling errors. What am I doing
wrong?

Thanks.






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
Undefined function error CLamar Excel Discussion (Misc queries) 3 June 5th 06 07:07 PM
Undefined function q Excel Programming 4 February 25th 06 03:47 AM
2147217900 undefined function jinsong Excel Programming 1 June 29th 04 04:23 PM
'Undefined Function' Error in Microsoft Query Jim Molter[_2_] Excel Programming 1 September 9th 03 11:20 AM
Excel 2000 VBA undefined function problem Matt. Excel Programming 1 August 8th 03 04:17 PM


All times are GMT +1. The time now is 09:13 PM.

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"