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

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
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,793
Messages
6,121,619
Members
449,039
Latest member
Mbone Mathonsi

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