Hi,
A part of the macro I wrote adds a new sheet to the active workbook. Until now, the code was working fine, but today I encountered the error message "That Command cannot be used on multiple selections", while trying to run the simple code:
Please note that the workbook is not protected, and multiple sheets are not selected. I have also tried this:
and this:
but none works.
I have realized that this error happens only when the other part of the macro runs the following code:
So when the SaveCopyAs code has not been run, I don't encounter any problem with adding sheets.
I cannot understand why this error happens, because before even when the code SaveCopyAs was ran I did not have any problem with adding sheets, and since then I have not changed anything about this part of the code where it adds new sheets.
Somewhere on the web somebody suggests using the following code:
before the add code, but it doesn't solve my problem. (I assume because my problem is not that multiple sheets are selected, because in the title bar I see no [Grouped] sign.)
Note that I am using Excel 2010.
P.S: After running the SaveCopyAs code mentioned above, I also cannot add sheets manually via Excel.
Bookmarks