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

Guraknugen

New Member
Joined
Mar 15, 2017
Messages
36
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

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
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,223,898
Messages
6,175,272
Members
452,628
Latest member
dd2

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