Can I get the currently defined date-separator in VBA?
Sorry... found it just after I posted: application.International(xldateseparator)
Date separator
-
- BronzeLounger
- Posts: 1254
- Joined: 03 Feb 2010, 19:59
- Location: Terneuzen, the Netherlands
-
- Administrator
- Posts: 78545
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Date separator
Yes, that's the solution in Excel VBA.
In Word VBA it's similar: Application.International(wdDateSeparator)
Other Office applications such as PowerPoint, Outlook and Access don't offer built-in support to retrieve local settings. In these programs, you can get the value from the registry value HKEY_CURRENT_USER\Control Panel\International\sDate:
Dim strDateSep As String
strDateSep = CreateObject("WScript.Shell").RegRead("HKEY_CURRENT_USER\Control Panel\International\sDate")
In Word VBA it's similar: Application.International(wdDateSeparator)
Other Office applications such as PowerPoint, Outlook and Access don't offer built-in support to retrieve local settings. In these programs, you can get the value from the registry value HKEY_CURRENT_USER\Control Panel\International\sDate:
Dim strDateSep As String
strDateSep = CreateObject("WScript.Shell").RegRead("HKEY_CURRENT_USER\Control Panel\International\sDate")
Best wishes,
Hans
Hans