Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,814
Default Faster closing of large spreadsheet

I use a Trend.xls to compile several other spreadsheets into. I copy and
paste some data into the master, in this case Trends.xls. When I close
"Impromptu DataDump rev3 2005 to present.xls", it takes up to 15 minutes. It
does not have any "upon close" code. Is there a better (faster) method to use
than the sample I have included below?
Thanks Steve

Workbooks.Open Filename:= _
(WhereDump & "Impromptu DataDump rev3 2005 to present.xls"):
ReadOnly = True
Worksheets("Sheet1").Range("A2:BW40000").Select
Selection.Copy
Workbooks("Trends.xls").Activate
Worksheets("Product_Code").Range("A2").Select
ActiveSheet.Paste
Application.StatusBar = "Closing Data Dump........."
Workbooks("Impromptu DataDump rev3 2005 to present.xls").Close
SaveChanges:=False
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 897
Default Faster closing of large spreadsheet

You don't need to select cells before copying them. The Copy Method
has a Destination argument where you can specify where you want the
copied values to be pasted.

Worksheets("Sheet1").Range("A2:BW40000").Copy Destination:=Workbooks
("Trends.xls").Sheets("Product_Code").Range("A2 ")

Also, do you have a lot of formulas in "Impromptu DataDump rev3 2005
to present.xls"? If so, they're probably recalculating when you do the
copy.

--JP

On Nov 26, 10:56 am, Steve wrote:
I use a Trend.xls to compile several other spreadsheets into. I copy and
paste some data into the master, in this case Trends.xls. When I close
"Impromptu DataDump rev3 2005 to present.xls", it takes up to 15 minutes. It
does not have any "upon close" code. Is there a better (faster) method to use
than the sample I have included below?
Thanks Steve

Workbooks.Open Filename:= _
(WhereDump & "Impromptu DataDump rev3 2005 to present.xls"):
ReadOnly = True
Worksheets("Sheet1").Range("A2:BW40000").Select
Selection.Copy
Workbooks("Trends.xls").Activate
Worksheets("Product_Code").Range("A2").Select
ActiveSheet.Paste
Application.StatusBar = "Closing Data Dump........."
Workbooks("Impromptu DataDump rev3 2005 to present.xls").Close
SaveChanges:=False


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,814
Default Faster closing of large spreadsheet

There are no formulas in the DataDump file that I am trying to close. It is
not the copy that is taking so long but the Close. Thanks for the Copy
Destination idea though.
Steve

"JP" wrote:

You don't need to select cells before copying them. The Copy Method
has a Destination argument where you can specify where you want the
copied values to be pasted.

Worksheets("Sheet1").Range("A2:BW40000").Copy Destination:=Workbooks
("Trends.xls").Sheets("Product_Code").Range("A2 ")

Also, do you have a lot of formulas in "Impromptu DataDump rev3 2005
to present.xls"? If so, they're probably recalculating when you do the
copy.

--JP

On Nov 26, 10:56 am, Steve wrote:
I use a Trend.xls to compile several other spreadsheets into. I copy and
paste some data into the master, in this case Trends.xls. When I close
"Impromptu DataDump rev3 2005 to present.xls", it takes up to 15 minutes. It
does not have any "upon close" code. Is there a better (faster) method to use
than the sample I have included below?
Thanks Steve

Workbooks.Open Filename:= _
(WhereDump & "Impromptu DataDump rev3 2005 to present.xls"):
ReadOnly = True
Worksheets("Sheet1").Range("A2:BW40000").Select
Selection.Copy
Workbooks("Trends.xls").Activate
Worksheets("Product_Code").Range("A2").Select
ActiveSheet.Paste
Application.StatusBar = "Closing Data Dump........."
Workbooks("Impromptu DataDump rev3 2005 to present.xls").Close
SaveChanges:=False



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Faster closing of large spreadsheet

I've never seen a workbook take that long to close -- especially if I'm closing
it without saving.

If you open it manually and close it manually, does it work ok?

Just a silly guess...

Are there any events that could be running when you close that workbook?

application.enableevents = false
Workbooks("Impromptu DataDump rev3 2005 to present.xls").Close _
SaveChanges:=False
application.enableevents = true

And even a sillier guess...

Clean up your windows temp folder.

Try closing excel and cleaning up your windows temp folder--it might help and it
can't hurt.

windows start button|Run
%temp%
is a quick way to get there.


Steve wrote:

I use a Trend.xls to compile several other spreadsheets into. I copy and
paste some data into the master, in this case Trends.xls. When I close
"Impromptu DataDump rev3 2005 to present.xls", it takes up to 15 minutes. It
does not have any "upon close" code. Is there a better (faster) method to use
than the sample I have included below?
Thanks Steve

Workbooks.Open Filename:= _
(WhereDump & "Impromptu DataDump rev3 2005 to present.xls"):
ReadOnly = True
Worksheets("Sheet1").Range("A2:BW40000").Select
Selection.Copy
Workbooks("Trends.xls").Activate
Worksheets("Product_Code").Range("A2").Select
ActiveSheet.Paste
Application.StatusBar = "Closing Data Dump........."
Workbooks("Impromptu DataDump rev3 2005 to present.xls").Close
SaveChanges:=False


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,814
Default Faster closing of large spreadsheet

Hi Dave
Manually closing is seconds. THere are no events (No code at all just data).
I moved the close statement after a block of code that opens and closes a
third spreadsheet (which closes quickly) and it closes very quickly when the
Close statement is in this new location.

"Dave Peterson" wrote:

I've never seen a workbook take that long to close -- especially if I'm closing
it without saving.

If you open it manually and close it manually, does it work ok?

Just a silly guess...

Are there any events that could be running when you close that workbook?

application.enableevents = false
Workbooks("Impromptu DataDump rev3 2005 to present.xls").Close _
SaveChanges:=False
application.enableevents = true

And even a sillier guess...

Clean up your windows temp folder.

Try closing excel and cleaning up your windows temp folder--it might help and it
can't hurt.

windows start button|Run
%temp%
is a quick way to get there.


Steve wrote:

I use a Trend.xls to compile several other spreadsheets into. I copy and
paste some data into the master, in this case Trends.xls. When I close
"Impromptu DataDump rev3 2005 to present.xls", it takes up to 15 minutes. It
does not have any "upon close" code. Is there a better (faster) method to use
than the sample I have included below?
Thanks Steve

Workbooks.Open Filename:= _
(WhereDump & "Impromptu DataDump rev3 2005 to present.xls"):
ReadOnly = True
Worksheets("Sheet1").Range("A2:BW40000").Select
Selection.Copy
Workbooks("Trends.xls").Activate
Worksheets("Product_Code").Range("A2").Select
ActiveSheet.Paste
Application.StatusBar = "Closing Data Dump........."
Workbooks("Impromptu DataDump rev3 2005 to present.xls").Close
SaveChanges:=False


--

Dave Peterson



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 897
Default Faster closing of large spreadsheet

I just noticed that your Open statement and Close statement have
different workbook names.

Workbooks.Open Filename:=(WhereDump & "Impromptu DataDump rev3 2005 to
present.xls")

Workbooks("Impromptu DataDump rev3 2005 to present.xls").Close

--JP

On Nov 26, 11:21*am, Steve wrote:
There are no formulas in the DataDump file that I am trying to close. It is
not the copy that is taking so long but the Close. Thanks for the Copy
Destination idea though.
Steve

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
VB to clear any filters when closing a spreadsheet Kevin Excel Discussion (Misc queries) 8 December 20th 07 06:05 PM
Closing Excel spreadsheet Project 13 Excel Discussion (Misc queries) 0 September 19th 07 04:58 PM
Making a spreadsheet calculate faster EricK Excel Discussion (Misc queries) 4 August 15th 07 10:08 PM
Make excel run large spreadsheets faster username22 Excel Discussion (Misc queries) 1 October 29th 05 03:44 PM
Can faster CPU+larger/faster RAM significantly speed up recalulati jmk_li Excel Discussion (Misc queries) 2 September 28th 05 10:24 AM


All times are GMT +1. The time now is 08:33 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"