A
Andy
Hi
I have an Access database for which I have written code
that outputs data to Excel and then runs an Excel macro.
The Excel object remains hidden while the macro runs. If
necessary, the macro will pop up a MsgBox but it doesn't
show on screen until you click on the Excel icon that
appears on the taskbar. As this is part of a loop, any
subsequent Excel message boxes do appear on screen. This
suggests to me that it has something to do with which
application has control/focus at the time the message box
is 'displayed'. My problem therefore is that I don't know
how to pass control to Excel so that the message box
appears first time.
A similar problem I have is that the Excel macro will
occasionally use the GetSaveAsFileName function to display
the SaveAs dialog box. However, unlike the problem above,
there is no way to actually view the SaveAs dialog box
while the Excel object is hidden and so the macro can't
continue. I have got round this by making Excel visible
before the GetSaveAsFileName function is used and then
hiding it again afterwards but I wonder if there is a more
elegant way of doing it.
Thanks in advance for any help!
I have an Access database for which I have written code
that outputs data to Excel and then runs an Excel macro.
The Excel object remains hidden while the macro runs. If
necessary, the macro will pop up a MsgBox but it doesn't
show on screen until you click on the Excel icon that
appears on the taskbar. As this is part of a loop, any
subsequent Excel message boxes do appear on screen. This
suggests to me that it has something to do with which
application has control/focus at the time the message box
is 'displayed'. My problem therefore is that I don't know
how to pass control to Excel so that the message box
appears first time.
A similar problem I have is that the Excel macro will
occasionally use the GetSaveAsFileName function to display
the SaveAs dialog box. However, unlike the problem above,
there is no way to actually view the SaveAs dialog box
while the Excel object is hidden and so the macro can't
continue. I have got round this by making Excel visible
before the GetSaveAsFileName function is used and then
hiding it again afterwards but I wonder if there is a more
elegant way of doing it.
Thanks in advance for any help!