Ken G. answered 12/20/19
Professional Software Developer & Mentor for over 20 years
The error Argument is not Optional indicates that you are not passing the correct number of parameters to your function. In the above function you need to give it 5 parameters: eqTime, longitude,timeZone,hours and minutes. A correct call to your code would look like this:
Wherever you are calling TrueSolarTime make sure that there are 5 numbers being passed in to the call.
Additionally there is an extra line in your function that is not needed. You can remove the line:
as the x variable is never used.