I am trying to convert a date into long using VBA script. Below is the code snippet
Sub test()
Dim str as string
Dim d as variant
str="1/1/2016"
d=cdate(str)
end sub
The above snippet runs fine on windows but is giving me type mismatch error on MAC. Is there any turnaround to convert a valid string in a date.
Your regional settings are the root cause.
Can you try modify them?
defaults write NSGlobalDomain AppleICUDateFormatStrings -dict 1 dd/MM/yyyy
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With