Hi
Yes the below code is intentional and the code that is breaking.
Sub Open_latest_file()
Application.DisplayAlerts = False
Application.ScreenUpdating = False
'Open the latest Wim Extract file.
sn = Array("\\G\All\", "\\G\All\", "") ' source directory / destination directory
sn(2) = sn(0) & Split(CreateObject("wscript.shell").exec("cmd /c dir """ & sn(0) & "*.zip"" /b/o-d").StdOut.ReadAll, vbCrLf)(0)
With CreateObject("Shell.Application")
.Namespace(sn(1)).CopyHere .Namespace(sn(2)).Items.Item(0)
sn(2) = sn(1) & .Namespace(sn(2)).Items.Item(0)
End With
Workbooks.Open sn(2)
I just changed my network names for the purpose of this post.
Thanks.