Podrias ver con
FindFirstFile si hay archivos o carpetas en la ruta , dame unos minutos y te hago un source.
EDIT:
Lo prometido es deuda , la función es 100% funcional , el parametro que hay que pasarle es lla ruta de la carpeta sin \ ni nada adelante por ejemplo para revisar C:\ ponemos C: .
Private Declare Function FindNextFile Lib "kernel32" Alias "FindNextFileA" (ByVal hFindFile As Long, lpFindFileData As WIN32_FIND_DATA) As Long
Private Declare Function FindFirstFile Lib "kernel32" Alias "FindFirstFileA" (ByVal lpFileName As String, lpFindFileData As WIN32_FIND_DATA) As Long
Private Type FILETIME
dwLowDateTime As Long
dwHighDateTime As Long
End Type
Private Type WIN32_FIND_DATA
dwFileAttributes As Long
ftCreationTime As FILETIME
ftLastAccessTime As FILETIME
ftLastWriteTime As FILETIME
nFileSizeHigh As Long
nFileSizeLow As Long
dwReserved0 As Long
dwReserved1 As Long
cFileName As String * 260
cAlternate As String * 14
End Type
Dim Find As WIN32_FIND_DATA
Dim HandleBusqueda As Long
Public Function CapetaVacia(Ruta As String) As Boolean
HandleBusqueda = FindFirstFile(Ruta & "\*", Find)
FindNextFile HandleBusqueda, Find
If Left(Find.cFileName, 2) = ".." Then
FindNextFile HandleBusqueda, Find
Else
End If
If Left(Find.cFileName, 2) = ".." Then
CapetaVacia = True
Else
CapetaVacia = False
End If
End Function