Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Excel ファイルに保存されているレコードを更新するための最良の方法は何ですか。たとえばProduct ID、 、ProductName、およびを含むテーブルを含む MS Access データベースがありますProductAge。
Product ID
ProductName
ProductAge
この同じテーブルを Excel スプレッドシートに保存しています。その Excel スプレッドシートを調べてデータベース テーブルを更新する VBA コードを書きたいと思います。
データベースからレコードを削除してから、以下のコードを使用してスプレッドシート データを再度インポートできます (同じテーブルを想定)。
Docmd.RunSql("delete from tblData") DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel8, "tblData","C:\Data\Test.xls", True, "A1:E100"