View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
R Ormerod R Ormerod is offline
external usenet poster
 
Posts: 37
Default Excel VBA error - Select method of Range class failed

In a workbook with two worksheets, I receve this error message when closing
the file when the second worksheet is active, but not the first.

Debug points to code in a Private Sub relating to one (only) of eight combo
boxes in the first worksheet (which determine the contents of a selection of
cells in the second), as follows:

Private Sub ComboBox3_Change()

Range("A1").Select

This code is in located the worksheet, not the module.

I tried the following code to resolve the issue but no joy:

Sub Workbook_BeforeClose()

Sheets("Cover").Activate
Range("A1").Select

Both worksheets (apart from unlocked cells) and the workbook are protected.

Any ideas?

--
R Ormerod