In Excel, I've defined a VBA function that searches for a file. I'd like to prevent concurrent access to this function because otherwise the hard-drive gets unnecessarily thrashed.
This is the function I've defined:
Public Function findDocument(docName As String)
findDocument = findDocumentInFolder(docName, "C:\Correspondence")
End Function
I'm then calling it for thousands of cells in excel using the formula:
=findDocument(<cell reference>)
In java, we can control concurrent access by using the synchronized keyword. Is there any equivalent in VBA?
P.s. I assume it's running concurrently because at the bottom right of the excel window it says: Calculating: (4 Processors(s)): 9%