VBA – FSO Files, Folders, Drives and More | DEVelopers HUT
Mon May 06 2024 21:31:28 GMT+0000 (Coordinated Universal Time)
Saved by
@acassell
' Req'd Refs: Late Binding -> None required
' Early Binding -> Microsoft Scripting Runtime
#Const FSO_EarlyBind = True
#If FSO_EarlyBind = True Then
Private pFSO As Scripting.FileSystemObject
#Else
Private pFSO As Object
#End If
#If FSO_EarlyBind = True Then
Public Function oFSO() As Scripting.FileSystemObject
#Else
Public Function oFSO() As Object
#End If
If pFSO Is Nothing Then
#If FSO_EarlyBind = True Then
Set pFSO = New FileSystemObject
#Else
Set pFSO = CreateObject("Scripting.FileSystemObject")
#End If
End If
Set oFSO = pFSO
End Function
Public Sub oFSO_Clear()
'Be sure to always run this when closing your Form/DB to avoid
' hidden instances from running in the background!
Set pFSO = Nothing
End Sub
content_copyCOPY
https://www.devhut.net/vba-fso-files-folders-drives-and-more/
Comments