Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Error Message "Select method of worksheet class failed"

i get the above message whenever a document is opened read only. the
document has the following code

Private Sub Workbook_Open()

Sheets("Homepage").Select

and it fails on the first line. the problem is not present when the
document is opened normally (ie not read only).
there is no protection on any sheets, or any hidden sheets.

Thanks in advance.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 117
Default Error Message "Select method of worksheet class failed"

Try:
Sheets("HomePage").Activate

I know the Object Browser does not list the "Activate" method for the
"Sheets" class (Excel 2000), but that is what you generally use. As a
general rule, you "Activate" worksheets, charts, workbooks, windows, the
active cell, etc., and you "Select" ranges of cells, chart plot area, chart
title, etc. The Help topics are a little confusing on this, but this seem to
be a common problem.

The Activate method is listed for the "Worksheet" and "Chart" classes in the
Object Browser, however.
--
Regards,
Bill


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default Error Message "Select method of worksheet class failed"

hi , have tried activate and still get same error message?
any more ideas

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 117
Default Error Message "Select method of worksheet class failed"

Actually, my tests show that your code should also work as is. It does on my
machine (Excel 2000 with SP-3). Do you have all Service Packs in place? What
version are you running?

--
Regards,
Bill


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default Error Message "Select method of worksheet class failed"

hi bill, have reduced the size of the spreadsheet by removing all
unnecessary formatting and the code now works without alterations. must
have been a bug somewhere but i always get annoyed when i dont get to
the solution.
but could be worse things on a monday morning eh!
thanks for your help.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 117
Default Error Message "Select method of worksheet class failed"

Maybe you had the sheet named differently than your code was expecting (i.e.
a space in the name of the sheet, and no space in the code). Or a name clash
somewhere (2 procedures with the same name in 2 different modules), but then
you would think that the compiler would raise an error.
--
Regards,
Bill

"philcud" wrote in message
oups.com...
hi bill, have reduced the size of the spreadsheet by removing all
unnecessary formatting and the code now works without alterations. must
have been a bug somewhere but i always get annoyed when i dont get to
the solution.
but could be worse things on a monday morning eh!
thanks for your help.



Reply
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
"Select method of Range class failed" Error Ayo Excel Discussion (Misc queries) 3 September 2nd 08 07:58 PM
Run-time error "1004" Select method of range class failed Tallan Excel Discussion (Misc queries) 3 March 7th 07 05:22 PM
VBA error 1004 "Select method of Range class failed" Matt J Excel Programming 6 July 3rd 04 10:05 PM
Error 1004, "select method of range class failed" paritoshmehta[_11_] Excel Programming 3 May 6th 04 10:09 PM
Runtime Error "1004" Select Method of Range Class Failed Stephen[_7_] Excel Programming 4 April 10th 04 06:28 AM


All times are GMT +1. The time now is 01:24 AM.

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"