LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 72
Default Can't seem to find the error with this code

Hi,
I don't know why I can't pass thru this code. I know it's fairly straight
forward but everytime I run it's always giving the error "Object required"
even if my active workbook contains the sheetname "mydata". Can you tell me
what's wrong with this code. All I am trying to do is to check if a sheetname
exists.

On Error Resume Next
Set x = ActiveWorbook.Sheets("mydata")
If Err = 0 Then
MsgBox "Passed "
Else
MsgBox ActiveWorkbook.Name & " - " & Error(Err)
MsgBox "Sheet does not exist"
End If

Thanks
 
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 dialog box meaning and how to find error Jeanne Excel Worksheet Functions 2 September 4th 08 04:59 AM
Code to find code D. Excel Discussion (Misc queries) 2 August 12th 07 06:16 PM
help with this error-Compile error: cant find project or library JackR Excel Discussion (Misc queries) 2 June 10th 06 09:09 PM
How can I still go to the error-code after a On Error Goto? Michel[_3_] Excel Programming 2 May 4th 04 04:21 AM
Code Error - Run Time Error 5 (Disable Cut, Copy & Paste) Tim[_36_] Excel Programming 4 April 23rd 04 02:53 AM


All times are GMT +1. The time now is 12:28 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"