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

Running an excel macro inside access

Status
Not open for further replies.

justlearning2003

Technical User
May 26, 2003
34
0
0
CA
Hey,

Anyone have any advice on how to run an excel macro from Access. For example if i have the file open in excel and I want to jump from Access to excel and run the macro.

Any ideas would be great thanks
 
I don't believe you can do that.

What is it that you want to accomplish?

"I have never killed a man, but I have read many obituaries with great pleasure." - Clarence Darrow
 
Could you provide some more information, what you want ot do? I could help you out.


Hope this helps... :)
Hasu
(Trust on someone, someone will trust you!)
 
Hey,

Basically I have a macro created in Excel that I would like automatically started by using say a command button in Access. I guess to "Call" the Excel macro.

Thanks
 
Is this just for you or will you be giving your application to others?

Is there a way (in Excel) to automatically start a macro when Excel starts?

Hasu and I both asked exactly what it is you wanted to do; if you answered that, perhaps we could help you. Your last post was a bit vague....

"In America, anyone can become president. That's one of the risks you take." - Adlai Stevenson
 
Hey guys,

First of all create Macro1 in Book1.xla excel file and save it and then close that file. Now, create a button on access form and paste below code in button click event, this code will run macro of excel and after you can open excel fiel to verify.


Private Sub cmdCallMacro_Click()

Dim xla As Object, xlw As Object
Dim itm As Integer

Set xla = CreateObject("Excel.Application")
Set xlw = xla.Workbooks.Open(CurrentProject.Path & "\book1")

xla.Run "Macro1"

xla.ActiveWorkbook.Save

xlw.Close
Set xlw = Nothing
Set xla = Nothing

MsgBox "Process complete!", vbInformation

End Sub



Hope this helps... :)
Hasu
(Trust on someone, someone will trust you!)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top