Any help is greatly appreciated.
Dim objFSO Dim sSourceFolder Dim sDestFolder Dim sDBFile Dim sDateTimeStamp 'Const OVER_WRITE_FILES = False Set objFSO = CreateObject("Scripting.FileSystemObject") sSourceFolder = "C:\Oceanside\" sBackupFolder = "C:\Files_Found\" sDBFile = "ROWP19-0578 PERMIT","ROWP19-0579 PERMIT" 'Expected end of statement error on this line when I try to search for two files sDBFileExt = "pdf" 'If the backup folder doesn't exist, create it. If Not objFSO.FolderExists(sBackupFolder) Then objFSO.CreateFolder(sBackupFolder) End If 'Copy the file as long as the file can be found If objFSO.FileExists(sSourceFolder & "\" & sDBFile & "." & sDBFileExt) Then objFSO.CopyFile sSourceFolder & "\" & sDBFile & "." & sDBFileExt,_ sBackupFolder & "\" & sDBFile & "." & sDBFileExt MsgBox sSourceFolder & " was copied to " & sBackupFolder End if Set objFSO = Nothing
Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.
”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.