Good evening
Can someone pls offer an explanation regarding the following piece of code
:
1:The routine initially reports a filecount of zero, returns an error “subscript out of range”
Rerun the script and all is well. It almost appears as if there is a need to pause so that the something can catch up ????
2: The call to “RegisterDocument” reads the document properties and updates an access datatable. The data is on another server and the routine completes 235 ( yes 235) loops then the database stops updating the records.
My question is “Can MS Access run out of “Buffer” if the server cannot update the records at the speed of the routine opening & reading the document properties …? The offending document can be processed alone ?!!!!
Meantime I will continue with the assumption that I have a logic error somewhere the routine that populates the database.
——————–
Sub BulkUpDateDataBase()
Dim FS
Dim i As Integer
Set FS = Application.FileSearch
Dim strFileName()
Application.ScreenUpdating = False
With FS.PropertyTests
.Add Name:=”Files of Type”, _
Condition:=msoConditionFileTypeWordDocuments, _
Connector:=msoConnectorOr
End With
ReDim strFileName(FS.FoundFiles.Count)
MsgBox (FS.FoundFiles.Count)
With FS
.LookIn = “C:DataWordDocs”
If .Execute(SortBy:=msoSortByFileName, _
SortOrder:=msoSortOrderAscending) > 0 Then
For i = 1 To .FoundFiles.Count
strFileName(i) = .FoundFiles(i)
Documents.Open (strFileName(i))
RegisterDocument
ActiveDocument.Close SaveChanges:=wdDoNotSaveChanges
Next i
Else
MsgBox “There were no files found.”
End If
End With
End Sub
———-
thanks in advance
Geof