Whoops, perhaps not. I tried changing the line to
Set Shortcut = ThisWorkbook.Application.CommandBars("Cell")
as you suggested. However when I opened a new blank workbook, the context item was still there. And if I shut down the workbook where I ran the code without invoking the Auto_Close subroutine the context item still persisted in a new blank workbook. The "ThisWorkbook" limiter doesn't seem to work, at least in my case.
|