Use Access VBA to run an Excel sub routine

  • Thread starter rirus via AccessMonster.com
  • Start date
R

rirus via AccessMonster.com

I am importing several Excel spreadsheets into one Access table. Before I can
do this, I open each Workbook... run a formatting sub routine located in a
seperate Excel Workbook... save the file and then open and format the next
one. Once they are all formatted correctly, I then run an Access VBA script
to import them into the table.

What I am wondering is if there is a way to run the Excel sub routine from
the Access sub routine before importing the formatted WorkSheets into the
table

Thanks,

Rirus
 
R

rirus via AccessMonster.com

I managed to find a document on using the auto_open subroutine. I created an
auto_open subroutine in the Excel workbook that asks if I want to format the
Excel spreadsheets. Click yes, it calls the original subroutine... Click no,
it exits the subroutine but leaves the Excel Workbook open. To run it from
the Access subroutine, I run a script that opens that Excel Workbook. When it
opens it runs the auto_open subroutine.

Works great!

Rirus
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top