ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Undefined function (https://www.excelbanter.com/excel-programming/354335-undefined-function.html)

q

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.



bigwheel

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.




q

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.






bigwheel

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.








All times are GMT +1. The time now is 05:42 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com