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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Running an Access VBA Module from an Excel VBA Macro 2

Status
Not open for further replies.

padinka

Programmer
Jul 17, 2000
128
US
I need to get an Excel VBA macro to run a VBA module in an access database. Can someone give me some code???
 
Sure,

Private Sub RunAccessStruff()
Dim objAccess as object
Set objAccess = CreateObject("Access.Application.8")

objAccess.OpenCurrentDatabase("C:\data\myAccess.mdb")
objAccess.Application.Run "Procedure1", Arg1, Arg2, Arg3

Set objAccess= Nothing

This will create an instance of an Access Application and call a function named 'Procedure1', then shut down the Application. There is actually a more efficient way to execute 'Function1' however using the Scripting component.

Enough? Let me know.






End Sub
 
THANK YOU, THANK YOU, THANK YOU. It works beautifully. I had given up on anyone answering my question. I really appreciate the help.
 
THANK YOU, THANK YOU, THANK YOU. It works beautifully. I had given up on anyone answering my question. I really appreciate the help.
 



It's been a while since I've gotten so much thanks ...
glad it helped, come back soon !



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top