Keyboard Shortcuts
Likes
Search
Re: Time is a reserved name in VBA
开云体育Richard,Thanks for the input you are always a great source of information. Reserved was probably the wrong word.? Microsoft calls Time a VBA keyword. For others to see the problem in action without having to even be concerned with the IB api. Create a module and put this code in it: Option Explicit Function TestTimeProblem() ??? TestTimeProblem = Time End Function Now in a cell on a worksheet enter this =TestTimeProblem() This should return the current time... Go back to the module and enter these additional lines of code 'Sub MakeTimetime(time As String) ' 'End Sub 'Sub FixTimeBackToTime(Time As String) ' 'End Sub Now un-comment the MakeTimetime routine and the Time in the function will change to time. Note that the function still works which as Richard indicated demonstrates that VBA is case agnostic. To fix back uncomment the FixTimeBackToTime sub and all will get changed to Time... It's hard to believe it has been almost 30 years since IB introduced their API.? Sorry that none of the developers hang out on this thread... On 1/31/2025 7:49 AM, Richard L King
wrote:
|