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

Posted on 2008-11-11
Medium Priority
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

ID: 22937677
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

gbergsma earned 0 total points
ID: 22969715
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

807 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