+ Reply to Thread
Results 1 to 3 of 3

Macro that currently opens 23 workbooks, looking to speed it up

  1. #1
    Forum Contributor
    Join Date
    09-04-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    298

    Macro that currently opens 23 workbooks, looking to speed it up

    I have a macro right now that does the following about 23 times:


    1. Open a workbook
    2. Paste that workbook into a sheet called "work area" on my main workbook
    3. Do Until on a large range of values
    4. Populate another worksheet within the same book (there is one worksheet for each of the 23 books opened)
    5. Close without saving the workbook I opened in step 1
    6. Clear the workarea sheet


    Right now the macro takes about 5 to 10 minutes or so for 4 books. Needless to say it would take quite a while to do all 23.

    I think the lag is within the opening and closing of the books. Would it be faster if I just kept a sheet that pulled data from those books instead of opening them?

  2. #2
    Valued Forum Contributor
    Join Date
    08-22-2011
    Location
    Auckland
    MS-Off Ver
    Excel 2019
    Posts
    716

    Re: Macro that currently opens 23 workbooks, looking to speed it up

    Do you have any code we can see?

  3. #3
    Forum Expert Doc.AElstein's Avatar
    Join Date
    05-23-2014
    Location
    '_- Germany >Outside Building things.... Mostly
    MS-Off Ver
    Office 2003 2007 2010 PC but Not mac. XP and Vista mostly, sometimes Win 7
    Posts
    3,618

    Re: Macro that currently opens 23 workbooks, looking to speed it up

    Quote Originally Posted by ks100 View Post
    .....
    I think the lag is within the opening and closing of the books. Would it be faster if I just kept a sheet that pulled data from those books instead of opening them?
    If you are pulling data from closed Workbooks you will, I think, need to reference one cell at a time, so that could take a while. As Philb1 said we need to see a code and maybe also a file or two to see exactly what you are doing. I have a fairly old system but I would never need anything like 5 minutes to open and close 4 books. Anyway you can see if how long that is taking cant you ?
    . Usually things take a long while if you are continually referencing the spreadsheet. Every time you do something on a sheet it is like slamming the brakes on. As much as possible you should try to bring as much data in to a code in one go as possible , work on it “internally” as much as you can and then try to paste out large amounts in one go.

    Alan
    '_- Google first, like this _ site:ExcelForum.com Gamut
    Use Code Tags: Highlight code; click on the # icon above,
    Post screenshots COPYABLE to a Spredsheet; NOT IMAGES PLEASE
    http://www.excelforum.com/the-water-...ml#post4109080
    https://app.box.com/s/gjpa8mk8ko4vkwcke3ig2w8z2wkfvrtv
    http://excelmatters.com/excel-forums/ ( Scrolll down to bottom )

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Merging Workbooks and Speed
    By Prexcel in forum Excel General
    Replies: 2
    Last Post: 01-16-2014, 08:06 AM
  2. Speed up code that opens and pulls data from 30+ excel files and then closes file
    By chadwick140 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-06-2013, 09:58 AM
  3. [SOLVED] Macro that opens multiple workbooks and checks a cell value
    By ExcelFailure in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-18-2013, 08:45 AM
  4. Speed Testing Workbooks
    By squiggler47 in forum Tips and Tutorials
    Replies: 1
    Last Post: 05-09-2013, 09:31 PM
  5. Macro opens some MS workbooks, takes specific data in Master Workbook, then closes.
    By SunOffice in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-04-2010, 05:41 PM
  6. PC always opens 3 workbooks
    By Onky Wonky in forum Excel General
    Replies: 6
    Last Post: 05-17-2006, 10:50 PM
  7. RE: macro that opens a number of workbooks and close them
    By Alok in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-06-2005, 09:05 PM
  8. macro that opens a number of workbooks and close them
    By Hoshyar in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-06-2005, 09:05 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1