Runtime error 1004: Select method of worksheet class failed

  • Thread starter Thread starter chuckm
  • Start date Start date
C

chuckm

I have a workbook that works fine for me. But gives the above error when someone else tries it.

In Workbook_Open I have:

Application.ScreenUpdating = False

Sheets("Config").Select ======> it bombs here. Config definitely exists.

' read in key
key = Trim(Cells(2, 12))

Sheets("Readme").Select
Application.ScreenUpdating = True


I have run this on many versions of Excel with no problem (2010, 2007, 97....) on Win8, Win7 and earlier versions. I cannot reproduce the problem that the other person gets every time. They are running 2010 on win8. They have no other worksheets open.

Can anyone offer some guidance or advice?
Thanks
chuck
 
Hi,

Am Fri, 8 Nov 2013 11:07:58 -0800 (PST) schrieb chuckm:
In Workbook_Open I have:

Application.ScreenUpdating = False

Sheets("Config").Select ======> it bombs here. Config definitely exists.

' read in key
key = Trim(Cells(2, 12))

Sheets("Readme").Select
Application.ScreenUpdating = True

you don't have to use Select. Try:

Application.ScreenUpdating = False

With Sheets("Config")
' read in key
key = Trim(.Cells(2, 12))
End With

Sheets("Readme").Select
Application.ScreenUpdating = True


Regards
Claus B.
 
chuckm said:
Sheets("Config").Select ======> it bombs here. Config definitely exists.

but is probably hidden or protected and can't be selected so .select fails.
Claus already gave you solution.
Do not select anything if it does not have to be selected.
 
I have a workbook that works fine for me. But gives the above error when someone else tries it.



In Workbook_Open I have:



Application.ScreenUpdating = False



Sheets("Config").Select ======> it bombs here. Config definitely exists.



' read in key

key = Trim(Cells(2, 12))



Sheets("Readme").Select

Application.ScreenUpdating = True





I have run this on many versions of Excel with no problem (2010, 2007, 97....) on Win8, Win7 and earlier versions. I cannot reproduce the problemthat the other person gets every time. They are running 2010 on win8. They have no other worksheets open.



Can anyone offer some guidance or advice?

Thanks

chuck

Thanks for the advice....
The sheet that fails is not hidden or protected.

Why would it always work for me and always fail for someone else? What other things should I be looking into?
chuckm
 
Back
Top