Hello.
I wrote a Excel Macro which writes Names of Files from a SharePoint Library in an Excel Sheet.
Also some of the Document Properties are written in the sheet, but reading them needs quite a long time, so the macro is working for 15 minutes or so if the library consists of 200 files.
The code where i read the properties is as follows:
Dim filename, strFilename As String
Dim objFile As Object
Dim dp As Object
filename = Dir("\\server\*.doc*")
Do While filename <> ""
strFilename = "\\server\" & filename & ""
Set objFile = GetObject(strFilename)
Set dp = objFile.ContentTypeProperties
ThisWorkbook.Worksheets("Documentlibrary").Range("b" & lastrow_excel_DB + 1).Offset(i, 0) = dp("User / Support")
i = i + 1
filename = Dir$()
Loop
I figured out that the line "Set objFile = GetObject(strFilename)" is the one who needs this long time to execute.
Is there a possibility to get this running faster?
Thanks for any suggestions.
Bookmarks