Click to See Complete Forum and Search --> : Excel object controlled from Access
January 27th, 2000, 04:10 PM
Our Access application creates an Excel workbook where some calculations are made. Excel creates a copy of the results to a new file (Backup) and is then supposed to give control back to Access and quit Excel. The workbook stays open as a kind of frame, but with no grid. Application.quit or visible=False does not make Excel disappear from the screen and Access doesn't get focus. Has anyone experienced this and found a solution ? Any tip on how to get Access focused is needed.
Thanks
Ingolf Brudeli
intelli@online.no
JimmyT
January 27th, 2000, 07:24 PM
Are you trying to have the Excel Spreadsheet quit/close itself or are you trying to close it using the Access routines? Without looking at your specific code (or a sample) I would think that as long as Access remains the controlling application (invoking Excel processes and working with the Excel spreadsheet) Access should be able to shutdown the spreadsheet and Excel when it is not needed anymore. If you have enabled a macro (or some other code) in the Excel spreadsheet, it might cause the loss of control that you have described and could prevent the Excel application from shutting down. I have experienced this same problem in an application that I am developing. My app is written in VB, it opens user selected Excel spreadsheets and archives the information to a user selected Access database. If the user selects an Excel Spreadsheet that has code attached to it (stuff that automatically occurs when the spreadsheet is open), I have not been able to shutdown the Excel spreadheet using my VB code. If the user selects an ordinary spreadsheet (sans code or macros) the VB code experiences no problems and can close down the Spreadsheet and Excel app.
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.