Having an issue with code that I “borrowed” from this site years ago – and am now trying to apply to files within a SharePoint site. In other respects – my limited experience has been that files, etc stored on these SharePoint sites behave similarly to files on any network drive, but I cannot get this file name array extraction routine to work.
Public Sub ID_ALL_Files() Upload_DWOR_Folder = Range("Upload_DWOR_Folder").Value FolderFileName = Dir(Upload_DWOR_Folder & "*.xls", vbNormal) ArrayPlaceHolder = 1 Files_To_Upload(ArrayPlaceHolder) = FileNameOnly(FolderFileName) Range("Upload_DWOR_Files").Cells(1, ArrayPlaceHolder).Value = Files_To_Upload(ArrayPlaceHolder) Do While FolderFileName "" FolderFileName = Dir() ArrayPlaceHolder = ArrayPlaceHolder + 1 Files_To_Upload(ArrayPlaceHolder) = FileNameOnly(FolderFileName) Range("Upload_DWOR_Files").Cells(1, ArrayPlaceHolder).Value = Files_To_Upload(ArrayPlaceHolder) Loop End Sub
Where
Upload_DWOR_Folder = http://sharepoint.mycompany.com/sites/teamsite/DWOR Upload/