LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #23   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 733
Default Declaring arrays

"Harlan Grove" wrote...
....
While I tested the first case, I did so in XL8/97, so under a
different VBA version. It does fail in XL8/97. I'll check under
XL2K when I get home. It'd be very odd if XL2K/VBA6 doesn't
throw an error when attempting to set a range reference to a
simple value.


It's not that. Excel is stranger than fiction sometimes. Pass an unsized
dynamic array of objects to another procedure as a variant argument, and
Excel 2000/VBA 6 treats the passed array of object references as having
LBound 0 and UBound -1. How silly of me not to have realized this.

Anyway, it looks like another revision is needed. Replace

ub1 = UBound(b, 1)
ct = (Err.Number < 9) 'only subscript out of range error

with

ub1 = UBound(b, 1) - LBound(b, 1)
ct = (Err.Number < 9 Or ub1 < 0) 'only subscript out of range error


 
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
Declaring a value to equal 100% Mark Charts and Charting in Excel 2 January 21st 05 02:18 PM
Declaring Variables Robert[_16_] Excel Programming 2 November 20th 03 04:16 PM
DEclaring variables Pedro Excel Programming 1 November 13th 03 05:02 PM
Declaring variables Pedro Excel Programming 1 November 13th 03 03:32 PM
DEclaring variables Pedro Excel Programming 2 November 13th 03 11:54 AM


All times are GMT +1. The time now is 12:34 PM.

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"