I've used the module below in VBA for Access successfully. Now, I need to do something similar in VB. I'm using Visual Studio 8 and have very little experience with it. The problem I'm running into is that it does not like the syntax for my "Set" declaration. Any thoughts would be appreciated.
Private Sub Command0_Click
Set fs = Application.FileSearch
With fs
.LookIn = "C:\Close Date Reporting\Reports"
.Filename = "Close Date Notification from*.xls"
If .Execute .execute
For I = 1 To .FoundFiles.Count
DoCmd.TransferSpreadsheet acImport, ,"Master Report Table", .foundfiles (I), True, "A18:G126"
Else
MsgBox "There were no files found."
End If
End With
End Sub
Private Sub Command0_Click
Set fs = Application.FileSearch
With fs
.LookIn = "C:\Close Date Reporting\Reports"
.Filename = "Close Date Notification from*.xls"
If .Execute .execute
For I = 1 To .FoundFiles.Count
DoCmd.TransferSpreadsheet acImport, ,"Master Report Table", .foundfiles (I), True, "A18:G126"
Else
MsgBox "There were no files found."
End If
End With
End Sub