Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
N L N L is offline
external usenet poster
 
Posts: 7
Default Error 1004 on long For loop, adding hyperlinks. What's going on?

Greetings.

I have a very large worksheet with about 110,000 rows, and a VBA
program that analyzes each of these rows, comparing their values with
other sheets in the same workbook.

In one Sub in my program, I have a For loop that I expect to execute
once per row (about 110,000 times). Its job is to add a hyperlink to a
cell if the values in the row have a certain value:

ActiveSheet.Hyperlinks.Add Anchor:=ActiveSheet.Cells(52206, 14),
Address:="", SubAddress:="TargetWorksheet!A1"


The problem is that I get a "Run-time error '1004': Application-
defined or object-defined error" on iteration #52205 (the counter in
the For loop reads 52205). I've previously only gotten this error when
I incorrectly referred to an object. Any idea why this is happening?

Could I be exceeding the acceptable range of a Hyperlink anchor?

Thanks,
N. Lee
  #2   Report Post  
Posted to microsoft.public.excel.programming
N L N L is offline
external usenet poster
 
Posts: 7
Default Error 1004 on long For loop, adding hyperlinks. What's going on?

On May 16, 9:29 am, N L wrote:
Greetings.

I have a very large worksheet with about 110,000 rows, and a VBA
program that analyzes each of these rows, comparing their values with
other sheets in the same workbook.

In one Sub in my program, I have a For loop that I expect to execute
once per row (about 110,000 times). Its job is to add a hyperlink to a
cell if the values in the row have a certain value:

ActiveSheet.Hyperlinks.Add Anchor:=ActiveSheet.Cells(52206, 14),
Address:="", SubAddress:="TargetWorksheet!A1"

The problem is that I get a "Run-time error '1004': Application-
defined or object-defined error" on iteration #52205 (the counter in
the For loop reads 52205). I've previously only gotten this error when
I incorrectly referred to an object. Any idea why this is happening?

Could I be exceeding the acceptable range of a Hyperlink anchor?

Thanks,
N. Lee


I've resolved the issue. Excel has a limit of 65,530 hyperlinks on a
single page. Instead of reporting this limit, VBA just gives a generic
error.
Shame on Excel on this shoddy behavior.

N. Lee
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 in loop danpt Excel Discussion (Misc queries) 4 February 11th 10 04:02 PM
run time error 1004 in loop danpt Excel Discussion (Misc queries) 1 February 10th 10 11:45 PM
trying to catch error 1004, don't work in 2nd loop... RompStar Excel Programming 2 April 16th 08 01:41 AM
Simple For-Loop gives 1004 error using variable to EntireRow.Delete EdMX Excel Programming 3 December 2nd 04 02:43 AM


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