I am running two visual basic modules in Access and keep coming across an annoying problem.
Both the vb modules transfer an excel spreadsheet to an access database but for some reason after the module has executed the excel spread sheets remain open in memory.
So if for some reason i try to go open the spreadsheets in excel i get a message saying that the spreadsheet is locked and can only be open in read-only mode.
When i press Ctrl+Alt+Delete , open task manager, and go to processes i can see two EXCEL.EXE process's running.
Once I end the process i can open the spread sheet and use it but otherwise it stays locked.
I researched online and came across the following code:
I tried using this code and it solved half my problem. So now what its doing is closing one of the EXCEL.EXE processes but one still remains open.
What kind of code can I use to close/exit all spreadsheets that might be open in memory.
Both the vb modules transfer an excel spreadsheet to an access database but for some reason after the module has executed the excel spread sheets remain open in memory.
So if for some reason i try to go open the spreadsheets in excel i get a message saying that the spreadsheet is locked and can only be open in read-only mode.
When i press Ctrl+Alt+Delete , open task manager, and go to processes i can see two EXCEL.EXE process's running.
Once I end the process i can open the spread sheet and use it but otherwise it stays locked.
I researched online and came across the following code:
Code:
myExcelApp.ActiveWorkbook.Close myExcelApp.Application.Quit
What kind of code can I use to close/exit all spreadsheets that might be open in memory.
Comment