How can I add to this code to only open SharePoint library documents that show "New"? The code works great for all documents.
Code:
Dim SummarySheet As Worksheet
Dim FolderPath As String
Dim NRow As Long
Dim FileName As String
Dim imgTitle As String
Dim WorkBk As Workbook
Dim SourceRange As Range
Dim DestRange As Range
Dim FolderName As String
Dim LR As Long
Set SummarySheet = Worksheets(3)
'Modify folder path when transferring between process owners
FolderPath = "//workspace.bsaconnect.com/fin/CaseManagement/PO Invoice Upload/"
'Nrow keeps track of where to insert new rows in the workbook
NRow = 1
'Call directory the first time pointing it to all excel files
FileName = Dir(FolderPath & "*.xls*")
'Loop until directory returns empty string
Do While FileName <> ""
'Open a workbook in the folder
Set WorkBk = Workbooks.Open(FolderPath & FileName)
'Set the cell in column A to be the file
'SummarySheet.Range("U" & NRow).Value = FileName
'Set the range to be A1000 through W1000
On Error Resume Next
Set SourceRange = WorkBk.Worksheets(1).Range("A2:M300")
On Error GoTo 0
'Set the destination range
Set DestRange = SummarySheet.Range("A" & NRow)
Set DestRange = DestRange.Resize(SourceRange.Rows.Count, SourceRange.Columns.Count)
'Copy over values from the source to the destination
DestRange.Value = SourceRange.Value
'Increase NRow so that data moves down
NRow = NRow + DestRange.Rows.Count
'Close source workbook
WorkBk.Close SaveChanges:=False
'Use Dir to get to the next file name
FileName = Dir()
Loop