Closed Thread
Results 1 to 2 of 2

Dramatically speed up VBA that requires the opening of large (SLOW LOADING) database

  1. #1
    Registered User
    Join Date
    08-18-2021
    Location
    Johannesburg
    MS-Off Ver
    2010
    Posts
    5

    Lightbulb Dramatically speed up VBA that requires the opening of large (SLOW LOADING) database

    Good evening,

    This post is both a question and an answer I figured out years ago coding in Excel VBA through trial, error, and experimentation. My final hack was not mentioned anywhere online
    and I'm hoping that this revelation may help someone in a similar situation.

    The problem:
    My code carried out calculations that involved finding items in a very large database list, and opening up this database workbook in my program was slowing my code down dramatically, sometimes up to 5 -10 minutes simply waiting for the database workbook to open in order to proceed reading off values.

    The solution:
    Don't open the database workbook. It is possible to actually copy the contents of an entire sheet of a closed workbook by referencing not just the Sheet in question and the workbook, but the entire file path of said workbook as part of articulating which sheet the information is being copied from. This copied information can now be pasted on a new sheet in the active workbook, thus granting you access to all the data from the closed database workbook without the slow process of opening up such a large file. This cut the running time of the 5-10 minutes database-workbook-opening part of the VBA to just 4-5 seconds. You can then simply delete the sheet that you created in order to paste the slow-loading database information onto when your code is done.

    The Question:
    I can send those interested a copy of the VBA code, which is really long and it has been sometime since I was familiar with the syntax and therefore it would prove quite a choke deciphering my own code again, but could someone kindly create an example VBA code that executes the above solution? Or would anyone be interested in helping me share my solution by having a read through my old VBA code and then pasting the relevant sections here for others who may languish under the burden of referencing workbooks of voluminous databases, the loading of which pollute one's code with a tardiness that render said code an embarrassment to any creator with the audacity to run it in full view of colleges in the workplace.

    The Key Principle
    You can access information from any closed workbook, by copying the cells/ sheets required, concatenating their referencing with the entire file path and filename of the closed workbook wherein they are contained and pasting the copied information in the open workbook, saving workbook loading times dramatically.


    I hope this discovery helps, and I further hope a benevolent volunteer take up my offer make this idea clearer by way of a coded example.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,705

    Re: Dramatically speed up VBA that requires the opening of large (SLOW LOADING) database

    Administrative Note:

    Welcome to the forum.

    Unfortunately, this is a duplicate thread, and you are allowed only ONE thread per issue here.

    Please see Forum Rule #5 about thread duplication.

    I am closing this thread, but you may continue here in the original thread
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

Closed Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Speed up slow loading program
    By torachan in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-18-2021, 10:24 PM
  2. Dramatically speed up VBA SLOWED by loading large reference database workbook
    By K.₿ ~ Knew Money in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-18-2021, 10:11 PM
  3. [SOLVED] Slow Macro - Large Database
    By BrooksN123 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-27-2019, 11:43 AM
  4. Speed up Opening of Large Workbooks?
    By atwy in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-13-2015, 03:13 AM
  5. Increasing File Opening Speed for Large Shared Files
    By petevang in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-03-2010, 10:13 PM
  6. Copied worksheet, large size, slow loading
    By logorrheac in forum Excel General
    Replies: 2
    Last Post: 08-10-2007, 03:57 PM
  7. [SOLVED] Slow opening database
    By Shirley in forum Excel General
    Replies: 0
    Last Post: 09-20-2005, 02:05 PM

Tags for this Thread

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