While reading the contents of a text file in VBA, I came across a date 31/OCT/2023. The language of the report is recognised (form example, sometimes also 28/FEV/2023 for French reports)
I know that I can manipulate the date in local language from a date perspective using a worksheet function TEXT. For example, I can change the string 31/OKT/2023 (Dutch) to 31 October 2023
(English) using
Application.WorksheetFunction.Text(datevalue(string))
.
However, due to my language settings Excel does not recognise OCT as a valid month. DateValue(31/OCT/2023) gives an error (invalid type).
I can off course create a custom function that includes all months for the report languages I process, but I was wondering if Excel or VBA also provided a standard function or method to a reverse lookup of a date string that is provided in another language (which is recognised based on other strings in the source report) to the language setting of Excel.
Anyone has an idea?
Art
Bookmarks