Solved

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

Posted on 1997-10-23
4
172 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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

734 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