Runtime error 1004: Select method of worksheet class failed

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
 
C

Claus Busch

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.
 
W

witek

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.
 
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 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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top