TheWennerWoman
Active Member
- Joined
- Aug 1, 2019
- Messages
- 303
- Office Version
- 365
- Platform
- Windows
Hello,
I have this which works but I need it modified to only open files less than 100kb in size:
Any help appreciated as always
I have this which works but I need it modified to only open files less than 100kb in size:
VBA Code:
Option Explicit
Sub OpenAllFiles()
Dim filpath As String
Dim fso As Scripting.FileSystemObject
Dim fil As Scripting.File
Dim fldr As Scripting.Folder
filpath = "C:\Users\Spartacus\OneDrive - Acme Toys\Documents\Daily Control Files\"
Set fso = New Scripting.FileSystemObject
Set fldr = fso.GetFolder(filpath)
Application.DisplayAlerts = False
On Error Resume Next
For Each fil In fldr.Files
With Application.Workbooks.Open(fil.Path)
.RefreshAll
' .Close False
End With
Next fil
End Sub
Any help appreciated as always