Solved

VB Program will only runs correctly some of the time

Posted on 2004-09-21
1
143 Views
Last Modified: 2010-05-02
I have a vb program that reads a number of files with differnt names and processes each file to add a header.

the program works great BUT the only problem is it sometimes misses the last file unless I place a msgbox in the code to be clicked.  It like the program needs to refocus to pick up the last file.

Does anyone have any ideas.

Thanks
0
Comment
Question by:running32
1 Comment
 
LVL 10

Accepted Solution

by:
Clif earned 50 total points
ID: 12114555
Use DoEvents after processing each file.  This will allow your app to "catch it's breath".
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

820 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