I have the code below that is supposed to parse a string in an Excel cell and open a mapped network drive based on that string. The code has worked perfectly for at least 5 years and still works today except for anyone that has Excel 2019. We have Excel versions from 2003 to 2019 running on Windows 10. The Excel 2019 users, the folder is opened to "My Documents" and not the specified folder. I have verified that the drives are mapped properly and you can paste the string into explorer and it will open the folder. I have searched everywhere and could not find a solution. Has something related to this changed in Excel 2019?
Here is the code:
The "IndexNumber" string is a 14 digit number and the directory structure is broken down in 2 character increments until the final directory being 4 characters and the last 2 characters of the string are ignored.
Example:
Index Number = 12345678901234
Path would be: Q:\ProjectFiles\12\34\56\78\0912\
Like I said, the exact same worksheet works fine on all computers on our network except for the users who have Excel 2019.
Thanks in advance for any help!
Here is the code:
VBA Code:
Dim sFolderPath As String
Dim sIndexNumber As String
' Get the index number
sIndexNumber = Sheets("ProposedTo").Cells(2, 7)
' Create the file path using the IndexNumber
sFolderPath = "Q:\ProjectFiles\" + Mid(sIndexNumber, 1, 2) + "\" + Mid(sIndexNumber, 3, 2) + "\" + Mid(sIndexNumber, 5, 2) + "\" + Mid(sIndexNumber, 7, 2) + "\" + Mid(sIndexNumber, 9, 4) + "\"
' Open the folder in new windows explorer
Shell "explorer.exe " & """" & sFolderPath & """", vbNormalFocus
The "IndexNumber" string is a 14 digit number and the directory structure is broken down in 2 character increments until the final directory being 4 characters and the last 2 characters of the string are ignored.
Example:
Index Number = 12345678901234
Path would be: Q:\ProjectFiles\12\34\56\78\0912\
Like I said, the exact same worksheet works fine on all computers on our network except for the users who have Excel 2019.
Thanks in advance for any help!