Access 2007 - DoCmd.RunCommand acCmdImport
DoCmd.RunCommand acCmdImportAttachExcel
This is what I was looking for. Works great.
I like the [ Do you want to overwrite table 'tblYourTable'? ] warning when
importing Excel worksheets as tables that have the same name as an internal
table. In Office 11 there was no warning and I had databases destroyed by
mistaken overwrites. I resorted to opening a one-record recordset on each
internal table (about 50 tables) and leaving them open until the import was
complete. This effectively locked the table and prevented any chance of
overwrite. I still have this code in place to be on the safe side.
|