Your code is correct. What you need to look at us is:
Dim Now As Date Dim CurrentHour = Hour(Now())
What causes error BC30471: the expression is not an array or method and cannot have a list of arguments.
Now you see the problem, perhaps the Now variable hides the Now function. The compiler is now confused, it does not understand why parentheses are present. And rightly complains that Now is not an array, not a method. This is no longer the case.
Besides renaming a variable, you can also solve it by providing a more complete name:
Dim CurrentHour = Hour(DateAndTime.Now())
Although this is becoming rather obscure, using DateTime.Now instead is a .NET path, not Basic.
source share