I have VBA code set up so that when the macro is run, a folder is created on a network drive, and then should open the created folder. However, it will only ever open the documents folder instead.
If I change the code to the below it correctly opens the folder in question (in this case the Applications
folder) - how can I get it to open the newly created one instead?
If .Value = "Section 50" And Cells(i, 6) <> "" Then
dirName = Cells(4, i).Values
MkDir ("\\richmond\data\Environment\Traffic & Transport\T&T - NetworkManagement\Street Works 2019-20\Licences\Section 50\Applications 2019-20\" & Cells(i, 4) & " (" & Cells(i, 12) & ")")
Call Shell("explorer.exe" & " " & "\\richmond\data\Environment\Traffic & Transport\T&T - NetworkManagement\Street Works 2019-20\Licences\Section 50\Applications 2019-20\", vbNormalFocus)
This code is part of a larger script so I've just shown the necessary section.
If .Value = "Section 50" And Cells(i, 6) <> "" Then
dirName = Cells(4, i).Values
MkDir ("\\richmond\data\Environment\Traffic & Transport\T&T - NetworkManagement\Street Works 2019-20\Licences\Section 50\Applications 2019-20\" & Cells(i, 4) & " (" & Cells(i, 12) & ")")
Call Shell("explorer.exe" & " " & "\\richmond\data\Environment\Traffic & Transport\T&T - NetworkManagement\Street Works 2019-20\Licences\Section 50\Applications 2019-20\" & Cells(i, 4) & " (" & Cells(i, 12) & ")", vbNormalFocus)