Determining Array Limit

C

Chaplain Doug

Excel 2003. I am using the following code to read filename(s) into a variant
array. How may I determine how many files were selected? Or how may I
determine

Dim Fname as Variant
FName = Application.GetOpenFilename("Excel Files (*.xls), *.xls", , "Select
RD Workbooks to Email", , True)

I get an error when I try to access FName and move beyond the last array
element trying to determine how many elements (file names) there are.
 
A

Alan Beban

Frank said:
Hi
have a look at UBound in the VBA help
More specifically, since it might not be apparent from the On-line help:

UBound(myArray) - LBound(myArray) + 1

Alan Beban
 
C

Chaplain Doug

Thank you Alan and Frank. God bless.

Alan Beban said:
More specifically, since it might not be apparent from the On-line help:

UBound(myArray) - LBound(myArray) + 1

Alan Beban
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top