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

Run Excel Macro from Access 1

Status
Not open for further replies.

LonnieJohnson

Programmer
Apr 16, 2001
2,628
US
I have an Access module that opens a workbook and plots some numbers in predetermined cells.

I created a macro in the excel workbook that closes the excel file.

How do I call the macro from my Access code after I am done plotting my numbers so the excel file can close?

If someone has a better way to close the entire file, I am open to that.

I was using xlsApp.ActiveWorkbook.Close, but this only closed the workbook and left the application window for excel open.

Thanks in advance.

ProDev, MS Access Applications
Visit me at ==>
May God bless you beyond your imagination!!!
 
LonnieJohnson
You can use the command Excel.Application.Quit to close Excel.

So in your case it should look something like:
xlsApp.quit

Hope this helps.
 
So simple, so close.
Thanks.
I have been working on this and it's pretty complicated. This was the last piece and I didn't even look at the methods and properties of the application object.

Thanks again.

ProDev, MS Access Applications
Visit me at ==>
May God bless you beyond your imagination!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top