Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default time problem


Hello,

I am trying to figure out why it takes so long to open workbook,
copy/paste data, save and close workbook. The more often this procedure
is repeated the longer it takes, and the larger the file size becomes,
althought there is not much change in the number of cells containing data

The worksheet has about 75 columns x 1300 rows of data. When the
workbook/worksheet is first created with all the cells populated with
data it takes 1-2 seconds to open,create data, close workbook. In my
application the subsequent procedures to do this now takes a whopping 20
-30 seconds.

I ran the following macro test for a similar size file for 100 repeats
of the procedure. The time increased from 1.8 to about 3.2 secs and
file size increased from about 3 Mb to 3.5 Mb. The file size seems
large to begin with for the amount of data on the worksheet (most of the
cells, though , does have a formula). For some reason test times are
much less than what I am getting in my actual application run.

Any suggestions would be appreciated. I am using Excel 2003


For n = 1 To 100
StartTime = Timer

'Open file
MySymbolPath = SymbolPath & SymbolName & ".xls"
wbName = SymbolName & ".xls"
Workbooks.Open Filename:=MySymbolPath
Set wS = Workbooks(wbName).Worksheets(SymbolName)

'Do Cut, copy,paste

Range("B10:CB1290").Select
Selection.Cut
Range("B1300:CB2580").Select
Selection.Insert Shift:=xlDown

Range("B19:H27").Select
Selection.Copy
Range("B10").Select
ActiveSheet.Paste
Range("I3:CB3").Select
Application.CutCopyMode = False
Selection.Copy

Range("I10:CB18").Select
ActiveSheet.Paste

Range("B10").Select
Application.CutCopyMode = False
ActiveWorkbook.Save
ActiveWorkbook.Close

EndTime = Timer
MsgBox Format(EndTime - StartTime, "0.00")
Next n
End Sub
Reply
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
Time problem Jon New Users to Excel 1 June 3rd 09 08:38 AM
Time problem - Help please sawagashi Excel Discussion (Misc queries) 7 November 18th 05 10:15 PM
Time Problem B. Baumgartner Excel Discussion (Misc queries) 2 June 30th 05 09:05 PM
Time Problem Ian Gilmore[_2_] Excel Programming 1 November 6th 04 02:20 AM
Problem when multipple users access shared xl-file at the same time, macrocode for solve this problem? OCI Excel Programming 0 May 16th 04 10:40 PM


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