View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Michiel via OfficeKB.com Michiel via OfficeKB.com is offline
external usenet poster
 
Posts: 48
Default Cannot call the worksheet function Weeknum

Anyone who can shine a light on this?

1) Worksheet functions can be called in VBA by using: Application.
WorksheetFunctionName
2) The worksheet function 'WeekNum' Exists
3) It works fine in my worksheet '=WEEKNUM(NOW(),1)'

Based on these I would say this would also work:

Sub WeekDay()
Dim dt As Date

dt = Now()
MsgBox Application.Weeknum(dt, 1)
End Sub

However I get: "Object doesn't support this property or method" (err#438)

I also know the Weeknum can be directly called from VBA by installing the Add-
In. But I just want to use the worksheet function.

Anyone?

--
Message posted via http://www.officekb.com