ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Want to find/read excel files in SharePoint (https://www.excelbanter.com/excel-programming/400633-want-find-read-excel-files-sharepoint.html)

BCNU

Want to find/read excel files in SharePoint
 
I had help on this before, but I was using 2003 at that time (I assume that's
the only change I'm up against).

using excel 2007, I'm trying to go to a company site, open a PO file (excel
..xls file) gather the data I need such as supplier name, qty ordered etc
into variables, put the values into the excel sheet on a data page, close the
sharepoint file and move to the next PO.
I had been using fs=application.filesearch, but I seem to be getting an
error now.

Option Explicit
Public Current_Row_Ctr As Integer
Public Sheet_Name As Variant
------------------------
Sub ProcessAll()

Dim wb As Workbook, i As Integer


With ThisWorkbook.Sheets("Data")
.Cells.Clear
'Set up Column Headers
'.Cells(1, 1) = "item #"
'.Cells(1, 2) = "Folder"
'.Cells(1, 3) = "Workbook"
'.Cells(1, 4) = "Worksheet"
End With
Current_Row_Ctr = 2

Set fs = Application.FileSearch
With fs
.LookIn = "\\companyweb.rlwinc.inner\Operations\AO\Purch ase Orders\"
.SearchSubFolders = True
.Filename = "*.xls"


If .Execute() Then
For i = 1 To .FoundFiles.Count
Set wb = Workbooks.Open(.FoundFiles(i))
ProcessWorkbook wb
wb.Close SaveChanges:=False
Next i
End If
End With
'Application.ScreenUpdating = True
'Clean_up

End Sub

--
Thanx

Jerry


All times are GMT +1. The time now is 09:04 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com