Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Calling a module function from a class method
Hello, I would like to know if it is possible to call a function that has bee defined in simple module from a method of a class (just as stati function). I tried to do it, but I have an error message 424 "Object required meaning probably that a object.method syntax was expecting. I tried also to call the function with module_name.function() but i failed... Thanks, Vinc ----------------------------------------------- ~~ Message posted from http://www.ExcelTip.com ~~View and post usenet messages directly from http://www.ExcelForum.com |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Calling a module function from a class method
You should be able to call a public function in standard module from
within a class (but I'd advise against it...) For example: This in a class module named Class1: Private Sub Class_Initialize() MyFunction End Sub This in a standard module: Public Sub Test() Dim c As Class1 Set c = New Class1 Set c = Nothing End Sub Public Function MyFunction() As Boolean MsgBox "Did it!" End Function Run the macro Test and see the message from the function, called from within the class. ranafout wrote in message ... Hello, I would like to know if it is possible to call a function that has been defined in simple module from a method of a class (just as static function). I tried to do it, but I have an error message 424 "Object required" meaning probably that a object.method syntax was expecting. I tried also to call the function with module_name.function() but it failed... Thanks, Vince ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~View and post usenet messages directly from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Creating UDF by Class Module (Leo)? | Excel Discussion (Misc queries) | |||
calling a module | Excel Discussion (Misc queries) | |||
CLASS MODULE & SIMPLE MODULE | Excel Discussion (Misc queries) | |||
Variable from a sheet module in a class module in XL XP | Excel Programming | |||
please give an example of a class module. | Excel Programming |