Suppress Warnings

G

Guest

Hello All,

Using Access 2003 on Win XP.
I have an Access macro that runs Access code. The code uses the
Application.FileSearch object to find, open and update to the latest excel
version, all the ".xls" files in a directory. Th problem I am having is that
I am unable to suppress the warning that each file that is accessed produces
as it tries to overwrite the existing file with the new version. In the
macro I have Warnings turned off. Inn the code I tried using
"Application.DisplayAlerts = False" but the message I get with that is
"Compile error: Meathod or Data member not found."

Anyone have any suggestions?

Thanks in advance for your help,
 
G

Guest

FYI... this is the filesearch code I am using.

Public Sub FSearch(fsPath As String, f_ext As String)
Dim fs
Dim i As Integer
Set fs = Application.FileSearch
With fs
.LookIn = fsPath
.FileName = f_ext
If .Execute(SortBy:=msoSortByFileName, _
SortOrder:=msoSortOrderAscending) > 0 Then
For i = 1 To .FoundFiles.Count
Workbooks.Open .FoundFiles(i)
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs ActiveWorkbook.FullName, xlWorkbookNormal
ActiveWorkbook.Close SaveChanges:=False
Next i
Else
MsgBox "There were no files found."
End If
End With
End Sub
'***************************************
' Calls FSearch()
'***************************************
Function XL_Update()
Call FSearch("C:\MyFolder\MySubFolder", "*.xls")
End Function
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top