+ Reply to Thread
Results 1 to 10 of 10

hundreds of workbooks left open (speed issue)

  1. #1
    Banned User!
    Join Date
    02-06-2020
    Location
    Iowa City, IA, USA
    MS-Off Ver
    2016 - 365 / 2007
    Posts
    2,014

    hundreds of workbooks left open (speed issue)

    I have to loop through 342 records in a book. and I am creating new workbooks based on data found in these recs. but not every rec will create a new book. if a book was previously created and subsequent duplicate data is found, the I/O stream will simply add that rec's data to the newly-created book previously. but can anyone here tell me if leaving ''x'' books open for the purpose I described would be a hinderance for the application? I mean, in terms of stack availability and heap issues, I don't think there is any, because books that are opened take no memory other than the mem. space for their object var. and an I/O stream doesn't take anything either. does anyone have any suggestion as to whether that would be a better method than the below code, which I am currently using? I would think that obviously it would be, for obvious reasons. I have a plan already, but I am just looking for input from the real pros that are around here, because I generally don't do this type of work. thanks!
    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,519

    Re: hundreds of workbooks left open (speed issue)

    Things like this certainly are not good for a speedy macro.
    Please Login or Register  to view this content.
    As far as your problem about the workbooks being open, I don't have an answer to that at all but it would be interesting to see the differences if you incorporate a timer in different macros.

  3. #3
    Banned User!
    Join Date
    02-06-2020
    Location
    Iowa City, IA, USA
    MS-Off Ver
    2016 - 365 / 2007
    Posts
    2,014

    Re: hundreds of workbooks left open (speed issue)

    Are you talking about logging the complete execution time regarding the different code routines that I have already written in my plan that I mentioned? Because if that's what you're talking about the code I wrote during the first version of this product that I returned to this employer I already created an in-out stream and logged errors and that includes the total execution time of the routine

  4. #4
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,519

    Re: hundreds of workbooks left open (speed issue)

    I was under the impression that it was a one book exercise. Apparently not. Sorry about that.

  5. #5
    Banned User!
    Join Date
    02-06-2020
    Location
    Iowa City, IA, USA
    MS-Off Ver
    2016 - 365 / 2007
    Posts
    2,014

    Re: hundreds of workbooks left open (speed issue)

    well yes it is. the code is executing behind ONE book. however, 4 books are open when the code stars running, and additional books are generated, per what we've already talked about, as the code goes through execution.

  6. #6
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,908

    Re: hundreds of workbooks left open (speed issue)

    It would be more efficient to collate all the data for a particular workbook at once, create it, close it, and move on.
    Rory

  7. #7
    Banned User!
    Join Date
    02-06-2020
    Location
    Iowa City, IA, USA
    MS-Off Ver
    2016 - 365 / 2007
    Posts
    2,014

    Re: hundreds of workbooks left open (speed issue)

    yes I know that Rorya. and that is what I will eventually end up doing because it does not make sense whatsoever to loop the recs without sorting them first. either that or using the .find methods in an un-sorted situation. and, if you're interested, I also had a question about another issue related to this here:

    https://www.excelforum.com/excel-pro...a-project.html

  8. #8
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,908

    Re: hundreds of workbooks left open (speed issue)

    If you know that, why did you ask the question?

  9. #9
    Banned User!
    Join Date
    02-06-2020
    Location
    Iowa City, IA, USA
    MS-Off Ver
    2016 - 365 / 2007
    Posts
    2,014

    Re: hundreds of workbooks left open (speed issue)

    Probably because I don't know everything that's why LOL even though I may sound like a smart-*** sometimes on the forum and may even say things on a deep level and no one else understands it doesn't mean that I'm God I mean you're better than I am in a lot of areas and so are a lot of other people here

  10. #10
    Banned User!
    Join Date
    02-06-2020
    Location
    Iowa City, IA, USA
    MS-Off Ver
    2016 - 365 / 2007
    Posts
    2,014

    Re: hundreds of workbooks left open (speed issue)

    And I find it comical that my trailing semi cuss word was censored I assume that was cloud fair that did that?

+ 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] VBA Open hundreds of Excels (prompt) and copy specific cells to other Excel document
    By Gordon85 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-06-2020, 02:16 PM
  2. One macro to open multiple workbooks and sheets issue
    By Darkcloud617 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-18-2019, 09:57 PM
  3. INDEX MATCH across hundreds of workbooks
    By neulite in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-03-2018, 06:52 PM
  4. [SOLVED] Workbooks open issue
    By TimlmiT in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-05-2018, 06:28 PM
  5. Replies: 4
    Last Post: 07-30-2016, 01:21 AM
  6. Replies: 6
    Last Post: 03-10-2014, 07:41 PM
  7. Eliminate need for duplicating source worksheets for hundreds of workbooks
    By snapfade in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-21-2013, 06:41 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