Closing Excel from Access Macro

  • Thread starter Thread starter Melinda
  • Start date Start date
M

Melinda

Hello,
I have a database that opens Excel with the
RunApplication command from the Macro Builder. Is there
a way that I can tell Access to close Excel after a
couple of other commands? I'm a pretty novice programmer.
Thanks!
Melinda
 
Not directly in a macro line. But you could write a function that will do
this (put the function in a regular module):

Public Function CloseMyExcel()
Excel.Application.Quit
End Function


Then call this function using a RunCode macro line.
 
Thanks for help. That worked perfectly. Now, my problem
is that Excel isn't open by the time that it tried to
close it. Is there a way to make the macro pause?
 
I'm not following you here. Are you wanting to use the same macro to both
open and then close EXCEL? What is happening inbetween?

I'm guessing that you should run the "Close of EXCEL" macro as a separate
macro that you trigger when you're ready for EXCEL to close.
 
I am having the same problem trying to close Excel when finished with it. I
have tried to use a macro with RunApp but am so new at this I am not even
sure what to put when it asks for function name. Help please
 
Back
Top