ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Runtime error 1004: Select method of worksheet class failed (https://www.excelbanter.com/excel-programming/449470-runtime-error-1004-select-method-worksheet-class-failed.html)

chuckm

Runtime error 1004: Select method of worksheet class failed
 
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

Claus Busch

Runtime error 1004: Select method of worksheet class failed
 
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.
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2

witek

Runtime error 1004: Select method of worksheet class failed
 
chuckm wrote:


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.


chuckm

Runtime error 1004: Select method of worksheet class failed
 
On Friday, November 8, 2013 2:07:58 PM UTC-5, chuckm wrote:
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


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


All times are GMT +1. The time now is 10:43 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com