Syntax inside a class module to call a built-in function

Guraknugen

New Member
Joined
Mar 15, 2017
Messages
34
Hi!

I'm working on a class for managing two dates. Right now I need a very simple WeekDay function, with the following syntax:
Code:
oMyObject.WeekDay(dDate As Date) As Long
The method looks, not very surprisingly, like this:
Code:
Private Function WeekDay(dDate As Date)
    WeekDay = WeekDay(dDate, vbMonday)
End Function
The idea is to use the already existing WeekDay function, but in this case VBA thinks that I try to use the class member WeekDay rather than the built-in WeedDay function.
So my question is: What is the syntax in this case to call the built-in WeekDay function from within this method in a class module?
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Code:
[COLOR=#0000cd]Private Function WeekDay(dDate As Date)
    WeekDay = [/COLOR][COLOR=#ff0000]VBA.[/COLOR][COLOR=#0000cd]WeekDay(dDate, vbMonday)
End Function[/COLOR]
 
Upvote 0

Forum statistics

Threads
1,214,978
Messages
6,122,549
Members
449,089
Latest member
davidcom

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top