Maybe it will work if you use the Unicode version of the functions.
I have the 64-bit Excel; the next modifications seems to help:
Public Type BROWSEINFO
hWndOwner As LongPtr
pidlRoot As LongPtr
pszDisplayName As String
lpszTitle As String
ulFlags As Long
lpfnCallback As LongPtr
lParam As LongPtr
iImage As Long
End Type
Public Declare PtrSafe Function SHBrowseForFolder Lib "shell32.dll" Alias "SHBrowseForFolderW" (lpBrowseInfo As BROWSEINFO) As LongPtr
Public Declare PtrSafe Function SHGetPathFromIDList Lib "shell32.dll" Alias "SHGetPathFromIDListW" (ByVal pidList As LongPtr, ByVal lpBuffer As String) As Boolean
Public Const BIF_RETURNONLYFSDIRS = &H1
Public Const MAX_PATH = 260
‘ . . . .
Dim bi As BROWSEINFO
Dim pidl, Path As String
Path = Space(MAX_PATH * 2)
bi.lpszTitle = "Directory"
bi.ulFlags = BIF_RETURNONLYFSDIRS
pidl = SHBrowseForFolder(bi)
Dim lResult As Long
lResult = SHGetPathFromIDList(ByVal pidl, ByVal Path)
If lResult Then
Path = StrConv(Path, vbFromUnicode)
TextBox1.Text = Path
End If
The checked folder name — “文件夹”— was displayed correctly in textbox. (However, the MsgBox and the Debugger are not able to display it).