VBA- SQL CopyFromRecordSet got slow without a reason

  • I have a procedure in VBA that i've been using for some time now to pull the data set from SQL DB.
    It always took less then 1 min to populate the template but since few days it's been taking more than 10 mins. nothing changed in Database, nothing changed in my vba code either...
    It stucks on :


    Sheets("NEW").Range("A3").CopyFromRecordset rst


    I even upgraded from office 2013 to 2016 but the issue still persists
    Any guesses what could be the reason?



    note:
    -the same file with same procedure works fine on my colleagues pc
    -table in question is about 54000 rows in 34 columns
    my code


    [Blocked Image: http://icons.iconarchive.com/icons/double-j-design/ravenna-3d/24/File-Copy-icon.png]

  • Re: VBA- SQL CopyFromRecordSet got slow without a reason


    Hello,


    This could be related to your sheet ... and not to your SQL query ...


    Just make a test with a brand new Sheets("TEAM") ...


    Hope this will help

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Thumbs Up" icon, below, in the bottom right corner:)

  • Re: VBA- SQL CopyFromRecordSet got slow without a reason


    thanks Carim, I did try that (created entirely new workbook with empty sheet, and run code from there) although it didn't help.Still the same issue

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!