dhutch75
07-22-2008, 01:44 PM
I'm opening an Excel spreadsheet from within MS Access. I open a spreadsheet and write database info to the spreadsheet using the following code:
Dim xlApp As Object
Dim xlBook As Object
Set xlApp = CreateObject("Excel.Application")
Set xlBook = xlApp.Workbooks.Open ("L:\Development\Workscope.xls")
'[Report writing code]
xlApp.Visible = True
Everything works properly, Excel opens, code executes, and the completed spreadsheet appears on the screen. If the user closes the 'Workscope.xls' file, without actually exiting Excel, the Excel app disappears from the screen and appears to have closed. It is still running in Task Mgr, however. Running several reports generates multiple instances of Excel, all of which persist until the user exits Windows.
How can I keep the Excel app visible if the user closes the spreadsheet?
Dim xlApp As Object
Dim xlBook As Object
Set xlApp = CreateObject("Excel.Application")
Set xlBook = xlApp.Workbooks.Open ("L:\Development\Workscope.xls")
'[Report writing code]
xlApp.Visible = True
Everything works properly, Excel opens, code executes, and the completed spreadsheet appears on the screen. If the user closes the 'Workscope.xls' file, without actually exiting Excel, the Excel app disappears from the screen and appears to have closed. It is still running in Task Mgr, however. Running several reports generates multiple instances of Excel, all of which persist until the user exits Windows.
How can I keep the Excel app visible if the user closes the spreadsheet?