View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default Force use of standard function

You shouldn't use VBA reserved words as function names. However,
you can force VBA to use its own function by including the VBA
library name:

Dim Res As Integer
Res = VBA.Year(whatever)

When you are calling your own Year function from within the class
module, use

Res = Me.Year(whatever)


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"Mark Olsen" wrote in
message
...
Hi,
I have a class module that has a function called Year().
Normally, this is
fine but in the class module I use the standard vba function
Year() to
extract the year from a date. However, vba thinks that this is
the class
modules Year() function. How can I tell it to use the standard
Year()
function without changing the name of the Year() function in my
class module.