Excel 2000 UNC issue with Visual Basic
Started by
popeil
, Sep 14 2005 07:34 PM
#1
Posted 14 September 2005 - 07:34 PM
#2
Posted 22 December 2006 - 09:43 PM
popeil,
I just did a quick test using the code below;
Sub popeil()
'
' Macro to count number of files in a directory
' Need to test drive letter assignment vs UNC
Dim myDir As String
Dim myCounter As Integer
'myDir = "Z:\Images\" 'Z: is mapped to \\OPTIMA11\Intray\ Images is a sub directory
myDir = "\\OPTIMA11\Intray\Images\"
With Application.FileSearch
.LookIn = myDir
.Filename = "*.*"
If .Execute > 0 Then
Debug.Print .FoundFiles.Count & " files were found."
End If
End With
End Sub
The code ran successfully and the result was the same for both methods of defining the directory
I am not aware of anything special you need to configure to allow UNC referencing
regards
dsm
I just did a quick test using the code below;
Sub popeil()
'
' Macro to count number of files in a directory
' Need to test drive letter assignment vs UNC
Dim myDir As String
Dim myCounter As Integer
'myDir = "Z:\Images\" 'Z: is mapped to \\OPTIMA11\Intray\ Images is a sub directory
myDir = "\\OPTIMA11\Intray\Images\"
With Application.FileSearch
.LookIn = myDir
.Filename = "*.*"
If .Execute > 0 Then
Debug.Print .FoundFiles.Count & " files were found."
End If
End With
End Sub
The code ran successfully and the result was the same for both methods of defining the directory
I am not aware of anything special you need to configure to allow UNC referencing
regards
dsm
Similar Topics
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users