Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default How to "bypass" run-time error '91'????

The following is part of a macro that will generate the following error
message:

"Run-time error '91':
Object variable or With block variable not set

I run this macro on an imported XML datatable that may or may not have
a particular dataset (see macro below). Since it's okay if this
dataset is missing (i.e., some projects may or may not have this
information - if not, then this dataset will be missing entirely), what
can be done to "bypass" this error statement?

Cells.Find(What:="/PROJECT/ISSUES/ISSUE/FOLLOWUP/ACTUAL_DATE", After:=
_ActiveCell, LookIn:=xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows,
_SearchDirection:=xlNext, MatchCase:=False,
SearchFormat:=False).Activate

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default How to "bypass" run-time error '91'????

dim rng as Range

set rng = Cells.Find(What:="/PROJECT/ISSUES/ISSUE/FOLLOWUP/ACTUAL_DATE",
After:=
_ActiveCell, LookIn:=xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows,
_SearchDirection:=xlNext, MatchCase:=False,
SearchFormat:=False)

if not rng is nothing then
rng.Activate
else
msgbox "Missing dataset"
End if

--
Regards,
Tom Ogilvy


"Jeff" wrote in message
oups.com...
The following is part of a macro that will generate the following error
message:

"Run-time error '91':
Object variable or With block variable not set

I run this macro on an imported XML datatable that may or may not have
a particular dataset (see macro below). Since it's okay if this
dataset is missing (i.e., some projects may or may not have this
information - if not, then this dataset will be missing entirely), what
can be done to "bypass" this error statement?

Cells.Find(What:="/PROJECT/ISSUES/ISSUE/FOLLOWUP/ACTUAL_DATE", After:=
_ActiveCell, LookIn:=xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows,
_SearchDirection:=xlNext, MatchCase:=False,
SearchFormat:=False).Activate



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
Run-time error "1004" Select method of range class failed Tallan Excel Discussion (Misc queries) 3 March 7th 07 05:22 PM
can I bypass "Windows has encountered a problem" fredashe Excel Discussion (Misc queries) 0 April 15th 06 04:53 PM
Bypass "DISable Macros" Chip R. Excel Programming 2 August 6th 04 06:23 PM
"Run-time error '1004'" Method 'Range' of object '_global' failed. haisat[_2_] Excel Programming 0 October 20th 03 12:13 PM
"Can't Show Modally" - Run-Time Error '400' Problem Bruce B[_2_] Excel Programming 3 July 14th 03 02:01 PM


All times are GMT +1. The time now is 08:25 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"