Home » excel » Can I fire-up an Access 2007 app from within Excel and automatically import excel values into Access?

Can I fire-up an Access 2007 app from within Excel and automatically import excel values into Access?

Posted by: admin May 14, 2020 Leave a comment

Questions:

I have a pawnshop app where when a customer arrives at the shop, the clerk uses an Excel worksheet to calculate how much money he can lend to the customer, based on the current market price of gold, gold karats and weight. If the customer agrees with the calculated amount, the clerk then goes into my Access 2007 pawnshop app and has to re-enter the price of gold and the total weight for each type gold karats. I would like to know if there’s a way for my Access app to automatically plug-in the values which were entered in the Excel worksheet.

How to&Answers:

From VBA within Excel, you could create an ADODB.Connection with a connection string pointing to the Access Database. Directly with the Connection object (but preferrably with an ADODB.Command object) you could run SQL inserts into the Access database that pulls its data from a Range on the worksheet.

This is assuming you have some sort of VBA knowledge which I am uncertain if you do as this question was not tagged with VBA.

Edit: You also need to make sure you include the Microsoft Data Access Objects Reference to the VBA project. (Use the latest version available to you)

Answer:

There might be a way, but I would implement the logic inside of a little database app with a calculate and apply button.