It doesn't appear the files are being explicitly opened. Something like this:
Option Explicit
Sub PrepData()
Dim LastRw As Long, fPATH As String, fNAME As String, wbDATA As Workbook
Application.DisplayAlerts = False
fPATH = "C:\Access\DataLogger\1_PrepData\"
fNAME = Dir(fPATH & "*.xls")
Do While Len(fNAME) > 0
Set wbDATA = Workbooks.Open(fPATH & fNAME)
With wbDATA.Sheets(1)
LastRw = .Range("A" & .Rows.Count).End(xlUp).Row
.Range("A1:G" & LastRw).Cut
'Add new sheet, copy data and delete old sheet
wbDATA.Sheets.Add(After:=wbDATA.Sheets(wbDATA.Sheets.Count)).Name = "Data"
Range("A1").PasteSpecial xlPasteAll
.Delete
End With
'insert column, name, obtain user required value and fill all cells for PIN column
Columns("A:C").Insert Shift:=xlToRight
Range("A1:C1").Value = [{"PIN","EventID","TimeStamp"}] 'column headers
Range("A2:A" & LastRw) = InputBox("Please enter the PIN number", "PIN request")
Columns("C:C").NumberFormat = "[$-409]m/d/yy h:mm AM/PM;@" 'user defined TimeStamp format
wbDATA.Close True 'save sheet
fNAME = Dir 'get next filename
Loop
End Sub
Bookmarks