Wrox Programmer Forums
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 12th, 2003, 11:46 PM
Registered User
 
Join Date: Aug 2003
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Very Slow Excel Files

Hi ,
    I am working on an excel application with around 40 sheets and a lot of VB Controls and interaction with Access database. The Excel file takes a huge amount of time to open , save or Close. Can any one tell me how to reduce this time???

 
Old August 13th, 2003, 01:24 PM
Authorized User
 
Join Date: Aug 2003
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Default

vikashtiwari,

Had you said that the execution of macros took a very long time, then I would have been able to suggest modifications to your code (such as turning off ScreenUpdating, setting the calculations to manual, using arrays instead of collections, etc.); but the problem with opening, saving and closing a file generally relates to the SIZE of the file.

One question I have though is -- When does the file connect to the database? If it connects when it's opened, then that might be cause for delay (it could be changed to connecting only when certain processes are run).

One of the things that often contributes to the size of Excel file (with the associated opening, closing, and out-of-memory problems) are storing complex formulas in a lot of cells. The way to alleviate this problem is to have any macros which create formulas to turn the formulas into values after the result is computed (by the formula).

To make a long story short —— you should probably experiment with different approaches and see which works best. Do you really need 40 worksheets in 1 workbook?

For more info recommend http://www.vba-programmer.com

CarlR

 
Old August 13th, 2003, 01:27 PM
Authorized User
 
Join Date: Jun 2003
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Turning calculation to manual rather than automatic can sometimes also help (so it doesn't recalculate upon opening, saving and closing).
 
Old August 14th, 2003, 02:04 AM
Registered User
 
Join Date: Aug 2003
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Carl,
   Thanx a lot for the suggestion. Actually i need 40 sheets in the workbook as it has a lot of functionality. The data is being stored in access databse from those sheets and i am setting the formulae for calculation on activation of each sheet. But yes my file size has bloated to 4 MB and each sheet has atleast 4-5 buttons.
Can you suggest anyway to reduce this overhead of OLE Buttons.
Vikash

 
Old August 14th, 2003, 08:40 AM
Authorized User
 
Join Date: Aug 2003
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Default

vikashtiwari,

You've said that each of your 40 sheets has 4-5 buttons.

Suggest that you remove these buttons from the worksheets -- simply having them there creates significant overhead -- and put them on one or more toolbars.

CarlR

 
Old August 11th, 2004, 08:21 AM
Registered User
 
Join Date: Aug 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to sarya
Default

I am also facing the same problem. I tries multi threading (VB.Net) but no use. Did you find any solution ?
Please share your though with me.

 
Old August 27th, 2004, 10:28 AM
Authorized User
 
Join Date: Mar 2004
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hello everyone.

The problem of SLOW open, save, and close of Excel is actually quite common. The solution is to delete all of your *.emf files. These are temporary files created by excel each time you open, add, change, etc... an Excel file. Over time, not only does your pc accumulate a lot of these files, but they can also become corrupt. If you use Excel often (which most of us do), you'll want to check for and delete these *.emf files.

Navigation =
     Start-->Search-->files & folders-->Local Disk
Enter *.emf in the file name box and then press FIND/SEARCH.


Rick
 
Old March 10th, 2008, 08:15 AM
Registered User
 
Join Date: Mar 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Code:
Windows Registry Editor Version 5.00


# rmccurdy.com

# DOC
[HKEY_CLASSES_ROOT\Word.Document.8\shell\Open\command]
@="\"C:\\Program Files\\Microsoft Office\\Office12\\WINWORD.EXE\" \"%1\""

# docx

[HKEY_CLASSES_ROOT\Word.Document.12\shell\Open\command]
@="\"C:\\Program Files\\Microsoft Office\\Office12\\WINWORD.EXE\" \"%1\""

# xlsx
[HKEY_CLASSES_ROOT\Excel.Sheet.12\shell\Open\command]
@="\"C:\\Program Files\\Microsoft Office\\Office12\\EXCEL.EXE\" /e \"%1\""

#xls
[HKEY_CLASSES_ROOT\Excel.Sheet.8\shell\Open\command]
@="\"C:\\Program Files\\Microsoft Office\\Office12\\EXCEL.EXE\" /e \"%1\""
 
Old April 22nd, 2008, 01:54 PM
Registered User
 
Join Date: Apr 2008
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Vikash.
Is it the only 40 sheets file closing that slow? What about the small files. Do they close fast enough? Check the regular size files.
If they also saving slow check if you have any mapped drives in your root.
Very often mapped drives linked to inactive computers cause this problem. Even 1 cell sheet could take a long time to save.

Regards,
Mike




 
Old April 22nd, 2008, 01:56 PM
Registered User
 
Join Date: Apr 2008
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Vikash.
Is it the only 40 sheets file closing that slow? What about the small files. Do they close fast enough? Check the regular size files.
If they also saving slow check if you have any mapped drives in your root.
Very often mapped drives linked to inactive computers cause this problem. Even 1 cell sheet could take a long time to save.

Regards,
Mike







Similar Threads
Thread Thread Starter Forum Replies Last Post
Generating Excel FIles from resource Files abinashpatra ASP.NET 1.0 and 1.1 Basics 0 July 28th, 2008 02:07 AM
Merge many excel files into one excel files Roshanjoshi2001 Excel VBA 2 November 14th, 2007 06:23 PM
XSLT to Excel transfer too slow JMnet ASP.NET 2.0 Basics 0 June 28th, 2006 02:40 PM
VB-Excel Slow Sometimes Brian149 Excel VBA 4 January 7th, 2005 03:29 AM
Opening Excel and Excel files dinosaur_uk VB.NET 2002/2003 Basics 3 September 17th, 2004 03:22 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.