spoolsv.exe consuming CPU when adding content to Excel worksheet from VBA

Posted on 2008-11-11
Last Modified: 2013-12-26

I have a VBAmacro under Excel. I am adding a lot of content to a number of worksheets and have found it to be very slow.

When I check Task Manager, there is a process "spoolsv.exe" that is consuming a stack of CPU time. If I kill it off, my macro runs like lightning.

Why would adding content to Excel worksheets cause a spoolsv.exe call anyway - isnt that related to printing?

Any suggestion as to how I can avoid spoolsv.exe from being called when I update the cells would be appreciated


Question by:gbergsma
    LVL 17

    Expert Comment

    Removing and adding rows is changing the page layout for printing purposes, that why it is getting bigger. I dont think there is a workaround for this, but read this link:

    it might help you out.

    im not sure if the same problem exist in excel 2007 (or 2002)

    Accepted Solution

    OK. I have a workaround. Hopefully it helps anyone else with this issue.

    1. I create new worksheet
    2. I add all my content (including page breaks)
    3. I set all the print layout stuff (paper size, zoom, fit per page, borders etc) - DO THIS LAST!

    Originally I had copied a sheet with all the print layout stuff set up. Step 2 above took an eternity, with spoolsv.exe taking a huge amount of CPU.

    It seems spoolsv.exe only gets called if Excel has to rework the print layout. If it doesnt know what the layout is, it doesnt call out to spoolsv. So, starting with a new sheet (ie. the print layout is undefined), and setting the print layout after filling out the cells in the sheet has made my printing well over 10 times as fast.



    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
    I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
    The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
    This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

    733 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now