+ Reply to Thread
Results 1 to 21 of 21

ComboBox lag

  1. #1
    Registered User
    Join Date
    06-15-2016
    Location
    canada
    MS-Off Ver
    2013
    Posts
    63

    ComboBox lag

    Capture.jpg
    I am having a weird lagging problem with my comboBoxes. There is a folder in ComboBox2("company") that is about 15GB and when I select that, It takes about 10 seconds to load. I noticed that If the folder is populated to the other two comboboxes, it doesn't lag there for some reason. It is ****ing me off and I can't find a way around it

    Is there a way to get rid of my lagging problem on comboBox2?

    Please Login or Register  to view this content.

  2. #2
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,916

    Re: ComboBox lag

    Hi, welcome,
    Are the S: and M: network shares or external (SUB) harddrives?
    It's a typical Windows issue when browsing, it takes a moment to 'wake-up'.
    If I address my NAS the first time it lags too but then it's okay and I have USB drive that always has to be 'woken-up' cannot keep it alive, I understand the issue but have no solution for it.
    ---
    Hans
    "IT" Always crosses your path!
    May the (vba) code be with you... if it isn't; start debugging!
    If you like my answer, Click the * below to say thank-you

  3. #3
    Registered User
    Join Date
    06-15-2016
    Location
    canada
    MS-Off Ver
    2013
    Posts
    63

    Re: ComboBox lag

    Quote Originally Posted by Keebellah View Post
    Hi, welcome,
    Are the S: and M: network shares or external (SUB) harddrives?
    It's a typical Windows issue when browsing, it takes a moment to 'wake-up'.
    If I address my NAS the first time it lags too but then it's okay and I have USB drive that always has to be 'woken-up' cannot keep it alive, I understand the issue but have no solution for it.
    Thank you.

    Those are both shared drives. The problem is that in the S drive, everything works perfectly but when it comes to the M drive, that one folder lags. I am not sure if it is the size or the code that I have there. Everything else works fine in the M drive.

  4. #4
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,916

    Re: ComboBox lag

    If you right click on the folder en select properties you will know how many files are in that folder and how large that folder is.
    You could disable your AntiVirus for a moment to test if that makes a difference, maybe the file types in that folder trigger an extra action that gives the lag.
    Don't forget to activate AV again.
    Last edited by Keebellah; 06-16-2016 at 02:32 AM. Reason: forgot something

  5. #5
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,914

    Re: ComboBox lag

    How about this ?
    code in module2.
    Attached Files Attached Files
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  6. #6
    Registered User
    Join Date
    06-15-2016
    Location
    canada
    MS-Off Ver
    2013
    Posts
    63

    Re: ComboBox lag

    Quote Originally Posted by bakerman2 View Post
    How about this ?
    code in module2.
    @bakerman2

    Thanks for the code. It seems to run fast but there is a problem. When I run the code, the first thing that pops up instead of the userform is " Msgbox " Wrong year?". When I click on OK, then try to choose something from the second comboBox, I get another popup " typo or company found" etc etc.

    So i keep getting popups.

    Thanks

  7. #7
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,916

    Re: ComboBox lag

    That means an error has occurred.

    Please Login or Register  to view this content.
    Have you tried stepping though the code (line-by-line)? Open VBA editor select the macro and press F8

  8. #8
    Registered User
    Join Date
    06-15-2016
    Location
    canada
    MS-Off Ver
    2013
    Posts
    63

    Re: ComboBox lag

    Quote Originally Posted by Keebellah View Post
    That means an error has occurred.

    Please Login or Register  to view this content.
    Have you tried stepping though the code (line-by-line)? Open VBA editor select the macro and press F8
    yeah, the weird thing is that it keeps working as i am getting the errors. His code is pretty advanced, I don't understand it. lol

  9. #9
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,916

    Re: ComboBox lag

    I cannot test it becasue I do not have a file with the userform
    But even if the code is 'pretty advanced' you can floow it step by step and check the moent if goes to the error line.

    You can disable the On error goto by placing a ' in front of that line, that way you get the actual error when it happens and then debug to check what the reason is for this error.

  10. #10
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,914

    Re: ComboBox lag

    This way it works for me without any MsgBox.
    Trouble posting code so have to put it in file.
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    06-15-2016
    Location
    canada
    MS-Off Ver
    2013
    Posts
    63

    Re: ComboBox lag

    Quote Originally Posted by bakerman2 View Post
    This way it works for me without any MsgBox.
    Trouble posting code so have to put it in file.
    This one works, but Now I can't have error Traps. lol

    also, is it possible to get rid of the CMD flashing everytime I select something from the ComboBoxes?

    Thanks

  12. #12
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,916

    Re: ComboBox lag

    No file, no idea what is flashing...

  13. #13
    Registered User
    Join Date
    06-15-2016
    Location
    canada
    MS-Off Ver
    2013
    Posts
    63

    Re: ComboBox lag

    Quote Originally Posted by Keebellah View Post
    No file, no idea what is flashing...
    I can't attach files yet because of I am new to the forum, but I have hosted it here if you like to download it

    http://expirebox.com/download/8968a0...4634a839c.html

    you will have to change the code with Bkerman2's code .

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

    Re: ComboBox lag

    Please don't cross post.
    If posting code please use code tags, see here.

  15. #15
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,916

    Re: ComboBox lag

    The expirebox link is blocked and marked ads untrustworthy by my protection software.
    Please seek another way.

  16. #16
    Registered User
    Join Date
    06-15-2016
    Location
    canada
    MS-Off Ver
    2013
    Posts
    63

    Re: ComboBox lag

    Are you still around? I am still having that issue.

    Someone please help me solve this problem.

  17. #17
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,916

    Re: ComboBox lag

    Here is the information to attach a file

    Please keep in mind that we do not have the same conditions you have with a S and an M shared drive.
    Attached Files Attached Files

  18. #18
    Registered User
    Join Date
    06-15-2016
    Location
    canada
    MS-Off Ver
    2013
    Posts
    63

    Re: ComboBox lag

    Have a look please.

    M drive(Jobs2017) is 17.2 GB.

    to launch the macro, CTRL + SHIFT + D
    Attached Files Attached Files

  19. #19
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,916

    Re: ComboBox lag

    The attached zip file seems to be corrupt, cannot open it, it asks for a disk.
    Could you please check and reattach?

  20. #20
    Registered User
    Join Date
    06-15-2016
    Location
    canada
    MS-Off Ver
    2013
    Posts
    63

    Re: ComboBox lag

    This one better work. :/
    Attached Files Attached Files

  21. #21
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,916

    Re: ComboBox lag

    The file is okay but like I mentioned, not much I can do for you.
    The code is full of hard-code filepaths that do not exist on my system so I get 'Wrong Year' due to the error trapping and the the rest goes wrong because of the file paths.
    So, I'm sorry, hope someone else can help.
    BTW why an xls file? Is this Excel 2003 or earlier?
    It's past midnight here, so I'm off to bed now.

+ 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. ComboBox values source being changed based on another combobox selection in a UserForm
    By stephenanderson in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-08-2016, 11:12 PM
  2. [SOLVED] Code required to Auto Populate 3rd Combobox based on 02nd Combobox Selection
    By bimmy80 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 12-14-2015, 03:56 AM
  3. Replies: 1
    Last Post: 11-07-2014, 01:21 PM
  4. Userform Combobox to populate form: Can I change the order of the columns in the combobox?
    By CraigWiggins in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-31-2014, 12:14 PM
  5. Populating Userform ComboBox Using Items from Content Control Combobox
    By anarxo in forum Word Programming / VBA / Macros
    Replies: 2
    Last Post: 01-17-2014, 01:00 PM
  6. [SOLVED] Make combobox list options dependant on selection in another combobox within a userform
    By Vladimir_Dobvchenko in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-23-2013, 05:30 AM
  7. [SOLVED] Excel Userform: Populate other controls (i.e. textbox & combobox) based on combobox select
    By MileHigh_PhD in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-22-2013, 04:50 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