I distribute tools in Excel form all over my company. I put them in a shared folder on one of our servers, and people copy them to their local computers to use them. Since some folks are too stupid to copy it first, and just open it right from it's shared location, I've been using a piece of code to check:

[vba]Private Sub Workbook_Open()


If Not Left(ThisWorkbook.FullName, 1) = Left(Environ("USERPROFILE"), 1) Or _
Not Left(ThisWorkbook.FullName, 1) = Left(Environ("windir"), 1) Then
MsgBox "This tool can not be run from a network location." _
& vbLf & vbLf & "Copy the .xls file to your desktop, and open it from there." _
, vbCritical, "File not local!"
ThisWorkbook.Close False
End If


End Sub[/vba]
This has always worked fine.

BUT. Now I have a tool with world-wide distribution, and it has started failing on computers in our UK office. Even when they copy it to their desktops, it trips the MSGBOX and closes. WHY?

What would make this fail?

I already tweaked the code once: first it only checked to see if the drive letter was the same as the drive with the Desktop, and now it it allows for either that OR the same drive letter as the windows disk.

Any suggestions appreciated.