How do you execute within the immediate window? I tried:
? Errrng.Parent.Hyperlinks.Add Anchor:=Errrng,
Address:="", _
SubAddress:=sStr1, _
TextToDisplay:=sStr
and recieved a compile error expected expression. Using
F8 does not work either to step through it after it has
failed
How exactly would I use the Do Event?
Thnks
>-----Original Message-----
>Hi ExcelMonkey,
>
>When you go into Debug mode on an error, can you execute
the Hyperlinks.Add
>from the immediate window?
>
>Errrng.Parent.Hyperlinks.Add Anchor:=Errrng, Address:="",
SubAddress:=sStr1,
>TextToDisplay:=sStr
>
>Or do you get a 1004 there?
>
>If you can do it in the immediate window, then it may be
a timing issue. I
>have run into this more times than I'd like - you can
step through code just
>fine, but when a routine is running at full speed, it
intermittently errors
>out. I've even had code that works perfectly on slow
machines that fail on
>faster machines due to timing issues. To see if that
could be happening,
>you can try adding a DoEvents right before the offending
line of code.
>
>--
>Regards,
>
>Jake Marx
>MS MVP - Excel
>www.longhead.com
>
>[please keep replies in the newsgroup - email address
unmonitored]
>
>
>ExcelMonkey wrote:
>> I posted this a few days back. Have not yet figured out
>> how to fix it. Effectively, the routine simply carries
>> out queries on a spreadsheet and prints results which
are
>> hyperlinks to cell addresses. The list of links can be
>> quite extensive. In some cases the list goes down to
row
>> 65,536. Each type of query is printed in a particular
>> column.
>>
>> During the routine, my code seems to periodically
>> failing. The error is a 1004 Error. However I can't
>> figure out why this happening. It happens in row 65,532
>> or 64,420 etc. However it just failed in row 1,111.
This
>> is the line of code it fails on. It fails after the If
>> statement on the the Errrng line:
>>
>> If RowCheck(Errrng) = False Then
>>
>> Errrng.Parent.Hyperlinks.Add Anchor:=Errrng,
Address:="", _
>> SubAddress:=sStr1, _
>> TextToDisplay:=sStr
>>
>> 'Increment paste range for next comment
>> Set Errrng = Errrng.Offset(1, 0)
>> End If
>>
>> When going to the immediate window I get:
>> ?RowCheck(Errrng) = FALSE
>> True
>>
>> ?Errrng.Address
>> $F$1111
>>
>> ?sStr1
>> 'Financing'!W37
>>
>> ?sStr
>> Financing!W37
>>
>> Can anyone tell me what is happening here?
>
>.
>
Bookmarks