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!

Converting Access Macro To Module and Run From Excel

Status
Not open for further replies.

NYFashionToGo

Technical User
Jan 16, 2007
76
US
I could use a bit of advice.... I have created a w access macro that I needed to refine. So I converted it to a Module and made the adjustments..... The original macro was controled from excel. And I am trying to get the converted Access Macro, to run the same way....


Originally in Excel I had This code: to do this

Sub UploadToAccess()

Dim appAcc As Object
Set appAcc = CreateObject("Access.Application")
appAcc.Visible = False

appAcc.OpenCurrentDatabase ("C:\NYFashionToGo\NYFOrderProcessing.mdb")
appAcc.DoCmd.RunMacro "Import Sales and Payments Info Macro"
appAcc.Quit


End Sub





I been trying to Update it to run the Module with no success:

Sub UploadToAccess()

Dim appAcc As Object
Set appAcc = CreateObject("Access.Application")
appAcc.Visible = False

appAcc.OpenCurrentDatabase ("C:\NYFashionToGo\NYFOrderProcessing.mdb")
appAcc.DoCmd.RunModules "Converted Macro- Import Sales and Payments Info Macro"
appAcc.Quit


End Sub


I am unsure what I am doing wrong or what I am supposed to do to get this application to work. Thank You In Advance.
 
Never Mind this post, I have figured it out..... I just created a new Macro to run the code from Access, and directed Excel VBA to run the new macro.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top