First a little background information.
I have a coldfusion/teradata driven web application. At some point the user needs to do some data manipulation so they click a link and an excel workbook launches in the internet explorer window (not in Excel itself).
The workbook itself operates fine, it loads data from the database, saves data to the database and does all the necessary interactions for the user to manipulate data. The problem is when the user needs to exit the workbook.
I have a command button on a worksheet that acts as a back button. When clicked, it directs the web browser away from the excel workbook and back to the web application (this is needed because the page they go back to needs to reload after using the workbook and the back button on the browser won't do that). The issue at hand is that I can't seem to close excel when I browse away from the workbook. I have tried application.quit, application.workbooks(me.name).close, application.workbooks(thisworkbook.name).close, application.activeworkbook.close, application.workbooks(hardcoded name).close. I have tried these right after I do my call to the web browser, and code does execute after I redirect the browser as I have seen with debug.print statements that execute.
Also, the workbook_beforeclose doesn't execute UNLESS I go into the vbe and click the stop button, then and only then do any of the .close commands work.
I need this to close because if the user wants to go back manipulate more data, and they click the link to launch the workbook again, I get an error message saying that the workbook is still open and you can't have two workbooks with the same name open.
How can I close Excel, or the workbook?
Right now I am forced to open the task manager and manually end excel before I can open it again.
Any ideas (other than opening the workbook in Excel instead of the web browser)?
I have a coldfusion/teradata driven web application. At some point the user needs to do some data manipulation so they click a link and an excel workbook launches in the internet explorer window (not in Excel itself).
The workbook itself operates fine, it loads data from the database, saves data to the database and does all the necessary interactions for the user to manipulate data. The problem is when the user needs to exit the workbook.
I have a command button on a worksheet that acts as a back button. When clicked, it directs the web browser away from the excel workbook and back to the web application (this is needed because the page they go back to needs to reload after using the workbook and the back button on the browser won't do that). The issue at hand is that I can't seem to close excel when I browse away from the workbook. I have tried application.quit, application.workbooks(me.name).close, application.workbooks(thisworkbook.name).close, application.activeworkbook.close, application.workbooks(hardcoded name).close. I have tried these right after I do my call to the web browser, and code does execute after I redirect the browser as I have seen with debug.print statements that execute.
Also, the workbook_beforeclose doesn't execute UNLESS I go into the vbe and click the stop button, then and only then do any of the .close commands work.
I need this to close because if the user wants to go back manipulate more data, and they click the link to launch the workbook again, I get an error message saying that the workbook is still open and you can't have two workbooks with the same name open.
How can I close Excel, or the workbook?
Right now I am forced to open the task manager and manually end excel before I can open it again.
Any ideas (other than opening the workbook in Excel instead of the web browser)?