LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 65
Default execution speed issue when closing files

I have a rather large application running on Windows 7/Excel 2007. The app has multiple routines, including some which update large networked directories of individual files with new data, some which read data from these files into a summarized report, etc.

The execution speed has always been a problem. The more I investigate, I'm finding the issue occurs when each individual file is being closed or saved.. The system hangs up for 30-60 seconds for each file. If I run a quick program which just opens and closes the files, the execution is significantly faster (on the order of 1-2 seconds/file)

I'm running down the network aspect, but I'm having little or no issues when I manually open/close/save these or any files. So, now I'm looking at the code itself.

I'm wondering if I've got an object creation issue, specifically:

Any of these routines start by creating a directory tree of the files I'm interested in on a temporary worksheet (I set this sheet as a worksheet object).

I also create a target worksheet if I'm running the summary report function

Next I loop through the directory sheet, opening up each file individually, set this sheet as another worksheet object, reducing/updating/extracting data as the case may be. Each of these directory files is then closed/saved and the loop continues to the end of the file list.

When the loop is complete and all files are updated, summarized, etc, all existing objects are set to nothing before the execution finishes.

Does VBA have problems with the way I'm creating or destroying objects? Should I set all local objects to nothing before I close each file, or does setting the objects in the next file I open keep the stack in check?

Art
 
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
Speed of Execution Mike H. Excel Programming 3 October 5th 07 12:31 PM
Speed up Excel execution Sinus Log Excel Programming 5 December 8th 05 05:03 AM
Execution speed for UDF Christian[_5_] Excel Programming 0 September 28th 04 04:20 PM
Extremely Slow VBA Execution Speed Joe Adams[_3_] Excel Programming 3 May 15th 04 01:23 AM
MACRO execution speed ericd Excel Programming 3 March 2nd 04 03:06 PM


All times are GMT +1. The time now is 04:17 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"