khalid79m
09-17-2008, 01:20 AM
:devil2:
Private Sub GatherStage1()
Application.DisplayAlerts = False
Application.DisplayStatusBar = True
Application.StatusBar = "Preparing Reports"
Dim i As Integer, wb As Workbook
With Application.FileSearch
.NewSearch
.LookIn = "\\ukhdat\Calling\ (file://ukhdat/Calling/)"
.SearchSubFolders = True
.Filename = "*.xls"
.Application.DisplayAlerts = False
.Execute
For i = 1 To .FoundFiles.Count
Set wb = Workbooks.Open(Filename:=.FoundFiles(i))
Run "GatherStage2"
wb.Close savechanges:=False
Next i
End With
Application.ScreenUpdating = True
Application.StatusBar = False
End Sub
Hi this bit of code works perfectly however I need to go into the file readonly .. can anyone help?
Private Sub GatherStage1()
Application.DisplayAlerts = False
Application.DisplayStatusBar = True
Application.StatusBar = "Preparing Reports"
Dim i As Integer, wb As Workbook
With Application.FileSearch
.NewSearch
.LookIn = "\\ukhdat\Calling\ (file://ukhdat/Calling/)"
.SearchSubFolders = True
.Filename = "*.xls"
.Application.DisplayAlerts = False
.Execute
For i = 1 To .FoundFiles.Count
Set wb = Workbooks.Open(Filename:=.FoundFiles(i))
Run "GatherStage2"
wb.Close savechanges:=False
Next i
End With
Application.ScreenUpdating = True
Application.StatusBar = False
End Sub
Hi this bit of code works perfectly however I need to go into the file readonly .. can anyone help?