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

running a macro

Status
Not open for further replies.

nutcase

Programmer
Jan 11, 2002
22
ZA
I have a vb6 application that folds, spindles and
mutilates data from a MS/Access mdb. I've been able to
do every thing but run an access macro from the vb code.

Anyone know how to do this?

thanks,
 
BTW, the DoCmd does not work. The application was
developed in Visual Studio and DoCmd only works
within the MS/Access application itself.
 
Problem is solved. With the help of our local VB expert
the following code will accomplish the task.

Copy from an ms/access table to a diskette in excel format using an access macro executed from a Visual Basic front end application


Dim accessApp As Access.Application
.
.
.
' Save to disk.....
Screen.MousePointer = vbHourglass
Set accessApp = CreateObject("Access.Application.8")
accessApp.OpenCurrentDatabase BudgetDataBase
accessApp.DoCmd.RunMacro "ExportGL"
accessApp.Quit
Screen.MousePointer = vbDefault
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top