End Function
Public Function TestFileExists(strFile As String) As Boolean
On Error Resume Next
TestFileExists = Not (Dir(strFile) = “”)
End Function
The code in the sample database requires a reference to the Excel object library;
Figure 3.7 shows this reference checked in the References dialog, which is opened
from the Tools menu in the Visual Basic window.
FIGURE 3.7
Setting a reference to the Excel object model.
After the worksheet of archived records has been created and saved, you will get a message
(depicted in Figure 3.8) listing the location where the archive worksheet was saved.
FIGURE 3.8
A success message after records are archived.
NOTENOTE
Analyzing Data with Excel 3