I know I'm being thick but, the following "almost" works. For some reason the string is not stored in the cell specified, yet the string length is saved and the msgbox shows the values to exist. What's going on? It's Friday I'm close to tears, the sun is shining and I'm off next week.
Private Sub CheckDirectory()
VarYear = Right(Date$, 4) ' Get the year
DoesTopDirExist = "\\OLDSERVER\Climate\Sales Orders (New)" ' Set base directory
If Len(Dir(DoesTopDirExist, vbDirectory)) = 0 Then ' Does the directory exist?
MkDir DoesTopDirExist ' if not create the directory
End If
DoesDirExist = DoesTopDirExist & "\Sales Orders " & VarYear ' Create an annual directory
If Len(Dir(DoesDirExist, vbDirectory)) = 0 Then ' Does the directory exist
MkDir DoesDirExist ' if not create it
End If
Sheet2.Cells(25, 253).Value = Len(DoesDirExist) ' save the length of the string
Sheet2.Cells(24.253).Value = DoesDirExist ' save the string (should be "\\OLDSERVER\Climate\Sales Orders (New)\Sales Order 2009")
MsgBox "File sub - " & DoesDirExist & " - " Len(DoesDirExist) 'Msgbox show "File sub - \\OLDSERVER\Climate\Sales Orders (New)\Sales Order 2009 - 55"
End Sub