+ Reply to Thread
Results 1 to 4 of 4

Combine VBA Modules to Speed Performance???

  1. #1
    Registered User
    Join Date
    07-29-2010
    Location
    Indiana
    MS-Off Ver
    Excel 2003, 2010, 2013
    Posts
    51

    Combine VBA Modules to Speed Performance???

    Can I get away with combining VBA modules into one module to speed performance of Excel?

    I have noticed when opening or closing my Excel file that contains 10 modules that each module is separately loaded/unloaded in the VBA editor window. I also assume that Excel does this when the file is opened/closed without the VBA editor window open. This results in it taking ~5 seconds for the file to open or close.

    I was wondering if I copy and paste all the modules into one module if that would make Excel open and close faster. Some of the modules will call upon other procedures/functions contained in a different module.

    Running WinXP Excel 2003

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

    Re: Combine VBA Modules to Speed Performance???

    Putting all the code in the same modules won't speed things up.

    Are you sure it's the code that's the problem?

    You mention the workbook takes ~5 secs to open/close, is there code running when you open/close?
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    07-29-2010
    Location
    Indiana
    MS-Off Ver
    Excel 2003, 2010, 2013
    Posts
    51

    Re: Combine VBA Modules to Speed Performance???

    Yes, I have code to hide/show buttons based upon the file name when the file opens. Since putting all the modules together won't increase performance then I will just leave them as it is. The performance isn't a big issue, and I believe it is more correlated with my system configuration (slow HDD, slow processor, low RAM).

    Thank you!

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

    Re: Combine VBA Modules to Speed Performance???

    Wouldn't do any harm to post your code.

    Perhaps there's something that can be done to speed it up a bit.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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