Hello,
I'm trying to import multiple Excel files into Access, but am getting:
Run-time error '3051':
The Microsoft Access database engine cannot open or write to
the file 'C:\Documents and Settings\H\Desktop\03-08-10'. It is
already opened exclusively by another user, or you need permission
to view and write its data
Any suggestions?
Thank you.
THIS IS MY CODE
Function Impo_allExcel()
Dim myfile
Dim mypath
mypath = "C:\Documents and Settings\H\Desktop\03-08-10"
Do
myfile = Dir(mypath & "*.xls")
'this will import ALL the excel files (one at a time, but automatically) in this folder. Make sure that's what you want.
DoCmd.TransferSpreadsheet acImport, 8, "03-08-10", mypath & myfile
myfile = Dir
Loop Until myfile = ""
End Function
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks