Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 37
Default Excel VBA error

I receive the following error message when closing an Excel file when one of
its unhidden worksheets is active, but not the other:

Run-time error '1004'
Select method of Range class failed

Debug points to code in a Private Sub (not in the Module) relating to one of
several combo boxes in the first worksheet, as follows:

Private Sub ComboBox2_Change()
Sheets("Cover").Range("C13").Select
End Sub

The LinkedCell for each combo box is a cell in the same worksheet, which in
turn feeds into a formula in the second worksheet (and I think this is where
Excel seems to be getting confused).

The ListFillRange for the combo boxes is located in a hidden worksheet.

If the Active Sheet is the forst worksheet, however, the file can be saved /
closed without any errors, so I tried this code:

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

But this did not work.

--
R Ormerod
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error: "Excel encountered an error and had to remove some formatti Carl Excel Discussion (Misc queries) 0 September 18th 06 06:39 PM
Counting instances of found text (Excel error? Or user error?) S Davis Excel Worksheet Functions 5 September 12th 06 04:52 PM
Excel 2003 Macro Error - Runtime error 1004 Cow Excel Discussion (Misc queries) 2 June 7th 05 01:40 PM
Downloading Templates for Excel error with a windows error. Lanie Moore Excel Discussion (Misc queries) 0 December 20th 04 11:39 PM


All times are GMT +1. The time now is 09:46 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"