ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Running Access VBA from Excel (https://www.excelbanter.com/excel-programming/389742-running-access-vba-excel.html)

Chergh

Running Access VBA from Excel
 
Hi folks,

Currently I am automating some reporting. I pull data from a linked table
into a table within Access and then do some calculations and make some
modifications to the table using vba I have written.

I then have excel vba which pulls the data from the access table I have
created into excel and the excel vba does calculations and draws up the
graphs I require.

Currently I have to open Access run the vba there then I go into excel and
run the vba there.

What I would like to do is run the Access vba from excel but have no idea
how. I'm using Excel and Access 2003 and am using DAO.

Chergh

Running Access VBA from Excel
 
Got it now just a case of:

dim accApp as access.application

set accApp = new access.application

accApp.openCurrentDatabase (path)
accApp.run(macro_name)
accApp.quit




"Chergh" wrote:

Hi folks,

Currently I am automating some reporting. I pull data from a linked table
into a table within Access and then do some calculations and make some
modifications to the table using vba I have written.

I then have excel vba which pulls the data from the access table I have
created into excel and the excel vba does calculations and draws up the
graphs I require.

Currently I have to open Access run the vba there then I go into excel and
run the vba there.

What I would like to do is run the Access vba from excel but have no idea
how. I'm using Excel and Access 2003 and am using DAO.



All times are GMT +1. The time now is 01:29 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com