K
Ken Snell
You are not being consistent in your reference to the EXCEL application.
You set exl to be the EXCEL application, and you use it to open the EXCEL
workbook. You then use EXCEL instead of exl in the next two lines of code.
You then set exl to Nothing while leaving the EXCEL instance running that
had been set to exl. Then you run the code again and start a new line of
EXCEL as exl, but you continue to use EXCEL, which likely is pointing to the
first and still running instance of EXCEL -- and in that application, the
workbook is now closed and not available!
You set exl to be the EXCEL application, and you use it to open the EXCEL
workbook. You then use EXCEL instead of exl in the next two lines of code.
You then set exl to Nothing while leaving the EXCEL instance running that
had been set to exl. Then you run the code again and start a new line of
EXCEL as exl, but you continue to use EXCEL, which likely is pointing to the
first and still running instance of EXCEL -- and in that application, the
workbook is now closed and not available!