moogthemoog
Board Regular
- Joined
- Nov 17, 2004
- Messages
- 51
Hi
In Excel 2010, under a Workbook_BeforeClose event, I have code to deselect any multiple selection of sheets.
This works fine, when closing an individual spreadsheet, whether or not multiple sheets are selected or not.
However, if there is more than one spreadsheet open, and Excel is exited via File/Exit, there is a "Run-time error '1004': Select method of Worksheet class failed" message.
Is there any alternative code to use that will work?
Thanks
Jon
In Excel 2010, under a Workbook_BeforeClose event, I have code to deselect any multiple selection of sheets.
Code:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
ActiveSheet.Select 'removes multiple selection of sheets
End Sub
This works fine, when closing an individual spreadsheet, whether or not multiple sheets are selected or not.
However, if there is more than one spreadsheet open, and Excel is exited via File/Exit, there is a "Run-time error '1004': Select method of Worksheet class failed" message.
Is there any alternative code to use that will work?
Thanks
Jon