+ Reply to Thread
Results 1 to 9 of 9

how to release cpu usage after run macro

  1. #1
    Registered User
    Join Date
    03-22-2020
    Location
    Colombia
    MS-Off Ver
    Office 365
    Posts
    18

    Unhappy how to release cpu usage after run macro

    Hi everyone,

    I made a macro that copy some info from a table with 2000 rows to aprox 30 new sheets.
    I was monitoring the CPU and RAM usage, the RAM is OK, but I saw that the CPU before execute the macro was in 1%, while the macro is running it increase to 20%, and after that, the % doesn't decrease. I think I've tried everything, like save the file, using DoEvents function between and after the code, clicked the stop button in the programmer window (despite the macro is over), but nothing works. The only way is close and open the file, to restore the CPU usage to 1%.

    And it's really important because while the cpu is in 20%, the ribbon is lagged, the option lists in the ribbon has ghosting, and is imposible to do a click in any option

    I appreciate any opinion to solve this.

    pd. Sorry for my bad english

  2. #2
    Forum Expert CheeseSandwich's Avatar
    Join Date
    12-22-2021
    Location
    Kent, England
    MS-Off Ver
    365 - 2402-17328.20068
    Posts
    1,359

    Re: how to release cpu usage after run macro

    Do you have a copy and paste line in your code?

    If so try adding the line
    Please Login or Register  to view this content.
    after every .Paste line.

    This line empties the clipboard after every paste and stops the clipboard expanding with data.

    May not be the issue but without seeing the code we can only have a guess.

    Hope this helps

  3. #3
    Registered User
    Join Date
    03-22-2020
    Location
    Colombia
    MS-Off Ver
    Office 365
    Posts
    18

    Re: how to release cpu usage after run macro

    thanx,
    Inicially I copy paste the data to complete the table, but after that I copy the info to the new sheets with for loops like
    Please Login or Register  to view this content.
    etc.
    but I'll use that for clear the clipboard.

  4. #4
    Forum Expert CheeseSandwich's Avatar
    Join Date
    12-22-2021
    Location
    Kent, England
    MS-Off Ver
    365 - 2402-17328.20068
    Posts
    1,359

    Re: how to release cpu usage after run macro

    Please Login or Register  to view this content.
    Yes this will not need the clipboard to be cleared because it has not been used.

  5. #5
    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,909

    Re: how to release cpu usage after run macro

    If the code has finished, it can't be using the CPU.
    Rory

  6. #6
    Forum Expert CheeseSandwich's Avatar
    Join Date
    12-22-2021
    Location
    Kent, England
    MS-Off Ver
    365 - 2402-17328.20068
    Posts
    1,359

    Re: how to release cpu usage after run macro

    Maybe it is related to graphics:

    Try the below, see if it makes any difference.

    Options, Advanced. Go to the Display section and check the option for "Disable hardware graphics acceleration"

    Hope this helps

  7. #7
    Registered User
    Join Date
    03-22-2020
    Location
    Colombia
    MS-Off Ver
    Office 365
    Posts
    18

    Re: how to release cpu usage after run macro

    I think that too, but it happened.
    I made a short video to show the problem, sorry for the blurr but is sensitive info.
    https://youtu.be/KgIav1a6eV4

  8. #8
    Registered User
    Join Date
    03-22-2020
    Location
    Colombia
    MS-Off Ver
    Office 365
    Posts
    18

    Re: how to release cpu usage after run macro

    Quote Originally Posted by CheeseSandwich View Post
    Maybe it is related to graphics:

    Try the below, see if it makes any difference.

    Options, Advanced. Go to the Display section and check the option for "Disable hardware graphics acceleration"

    Hope this helps
    I did it, but doesn't work, the diference is minimun.

    But is weird, because, sometimes only appears a little lag (cpu % low), and anothers lag and goshting (cpu %high)

  9. #9
    Registered User
    Join Date
    03-22-2020
    Location
    Colombia
    MS-Off Ver
    Office 365
    Posts
    18

    Smile Re: how to release cpu usage after run macro

    Hi guys,

    I want to say you that finally I solve this crap.

    I divide the sub in few subs and run one by one to find what lines causes the mistakes

    So I find some trash lines, that doesn't nothing and uses ram and cpu.
    Like count how many sheets are visible for no reason
    and some redundat code that I ran previously,

    in conclusion, my mistake...


    So thanks to everyone who reply my post,

    see ya

+ 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. Workbook usage or Database usage assistance
    By Sunshine601 in forum Excel General
    Replies: 4
    Last Post: 12-12-2013, 08:36 AM
  2. Macro to import Release details from the defect tab in QC ALM11.0 to wxcel
    By ananthbulusu in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-26-2013, 04:19 PM
  3. Hello..!! M here just learn basic Macro usage
    By kai-91 in forum Hello..Introduce yourself
    Replies: 2
    Last Post: 11-04-2012, 05:50 AM
  4. macro to release list filter
    By Excel idiot in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-14-2007, 03:08 PM
  5. where to ask questions about Macro usage in Excel
    By Khoshravan in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 05-11-2006, 06:38 AM
  6. countif usage in macro
    By parthaemail in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 02-08-2006, 12:10 PM
  7. [SOLVED] Macro error on MS Excel 10 for Mac Release 1
    By Linking to specific cells in pivot table in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-06-2005, 08:10 PM
  8. [SOLVED] FFT usage in Macro
    By bandy2000 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-25-2005, 01:06 AM

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