Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run Access Macro from Excel VBA

Status
Not open for further replies.

arryb

Programmer
Oct 27, 2003
27
GB
A croos post but i feel it has more relevance here.

I have a nagging issue that i need help with.

I have an excel document which is opening when a button from my access database is clicked. This button opens excel, closes access, and then gives the user various options to open several rtf files which are sorted and populated into different worksheets dependant on record type. These records then need to be imported into tables within my database.

To import this data i have a macro written in Access which works fine but need to be able to open my database and run that macro from excel VBA code.

This is what i cannot seem to do.

I cannot link these as this info is always changing. i also cannot import directly into access as the files i am importing are rtf's and that doesn't seem to work.

Does anyone have any suggestions for this.

All help appreciated.

Cheers

Arry
 
Does this help?

Sub AccessData()
Set acApp = CreateObject("Access.Application")
acApp.Visible = True
acApp.OpenCurrentDatabase ("C:YourDataBaseName.mdb")
acApp.DoCmd.RunMacro "MacroName"
End Sub

Regards,

Ian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top