Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Run time error 1004 in loop | Excel Discussion (Misc queries) | |||
run time error 1004 in loop | Excel Discussion (Misc queries) | |||
trying to catch error 1004, don't work in 2nd loop... | Excel Programming | |||
Simple For-Loop gives 1004 error using variable to EntireRow.Delete | Excel Programming |