By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,949 Members | 1,086 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,949 IT Pros & Developers. It's quick & easy.

Import and Export Periodically

P: 1
Hi,

I need to import an excel file to an access database and make certain queries, those queries results should be saved in an Excel Sheet. I want to know whether it is possible to import an excel file on a periodic basis using macros. Also is it possible to trigger a macro automatically?

Please help me in doing this.
May 17 '07 #1
Share this Question
Share on Google+
2 Replies


MMcCarthy
Expert Mod 10K+
P: 14,534
Hi,

I need to import an excel file to an access database and make certain queries, those queries results should be saved in an Excel Sheet. I want to know whether it is possible to import an excel file on a periodic basis using macros. Also is it possible to trigger a macro automatically?

Please help me in doing this.
All of this can be done with code. You have the option of importing or linking to the Excel sheet. You can export the query results the same way. Check out DoCmd.TransferSpreadsheet in the help menu. Access VBA code is event triggered so you could program this code to run when the database is opened or closed for example.
May 22 '07 #2

ADezii
Expert 5K+
P: 8,619
Hi,

I need to import an excel file to an access database and make certain queries, those queries results should be saved in an Excel Sheet. I want to know whether it is possible to import an excel file on a periodic basis using macros. Also is it possible to trigger a macro automatically?

Please help me in doing this.
Here is a basic Code Template for Importing an Excel 2000 Spreadsheet into Access. The following code will import an the Excel 2000 Spreadsheet named Test.xls in the C:\Test Directory into an Access Table named tblExcelImport. The 1st Row of the Spreadsheet does not have Field Names as indicated by the False Argument. This coce can be executed from a Macro if needed. What exactly do you mean by triggering a Macro automatically?
Expand|Select|Wrap|Line Numbers
  1. DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "tblExcelImport", "C:\Test\Test.xls", False
May 23 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.