Solved

file1.list(i) gives "..."

Posted on 1997-10-23
4
173 Views
Last Modified: 2008-03-06
okay, this should be easy. I have a loop going, processing some files. It goes through the loop and ALWAYS after the fifth time around, it comes back with a filename of "...", even though there are still many files left in the file list box. What's up with that???
0
Comment
Question by:dpms
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 6

Expert Comment

by:anthonyc
ID: 1438569
dpms,

I am not sure what's going on...  can you show me your code?  fIf you are looping through files, you can do this too....

dim strFile as string

strFile = dir("c:\windows\*.*") 'or whatever path you want
do until strFile = ""
    'process files the way you want
    strFile = dir() 'no path gets next file on the list
loop

0
 

Author Comment

by:dpms
ID: 1438570
Basically, it's like this
for i=1 to file1.filecount
   ---
CatchFileName=file1.list(i)
open CatchFileName as filenumber# for output

After five times around, it comes back as "..." and I can't
see why it does that with viable files still in the file list box.
0
 
LVL 6

Expert Comment

by:alamo
ID: 1438571
First of all,
 for i=1 to file1.filecount
should be
 for i=0 to file1.filecount-1
since the first item in the file list is item 0. but i doubt that's your problem, probably just a typo posting it here.

An obvious possibility is that somehow the value of  i is getting trashed so that you are not processing the item in the listbox you think you are. It's worth checking.

0
 
LVL 8

Accepted Solution

by:
MikeP090797 earned 50 total points
ID: 1438572
Try using SendMessage with LB_GETTEXT message. Maybe it's just a VB bug.
0

Featured Post

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month10 days, 23 hours left to enroll

632 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question