Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Whenever I perform certain operations in Word or Excel (2007), these applications are trying to reach the printer. I work on a laptop at work and at home. When I'm at home (not connected to my work's printer), I sometimes have to wait many seconds for Word/Excel to become responsive after performing operations such as making a cell bold in Excel, or pasting a paragraph from a webpage to Word.

In Word I may have a small message at the bottom saying something like "Trying to connect to the printer, press Esc to abort".

However

  1. That option does not exist in Excel

  2. and Sometimes if I do press Esc, Word crashes.

Is there a workaround?

share|improve this question
add comment

7 Answers

up vote 7 down vote accepted

My default printer is the PDF printer installed via CutePDF, which is free :)

As long as I have a local printer defined, and it's default, everything's fine.

I've seen the exact behavior you describe when switching fonts, and I think it's because some printers have allowable fonts, and Word is checking to see if they'll actually render on the printer (though why this is necessary until you actually print is beyond me).

share|improve this answer
    
Just made that change, but I'm currently connected to the network. I'll check if it works later, thanks. –  Roee Adler Sep 14 '09 at 13:18
1  
Worked like a charm, thanks –  Roee Adler Sep 20 '09 at 8:27
    
happy you're all set :) –  warren Sep 20 '09 at 9:02
add comment

I think the only way to avoid this is by having a default printer that is not remote. Here is a simple JScript that will set your default printer to "Microsoft XPS Document Writer" (assuming you have it installed) which is always a local, non-hardware printer.

var network = new ActiveXObject("WScript.Network");
network.SetDefaultPrinter("Microsoft XPS Document Writer");

Save that as SetDefaultPrinter.js and you can either run it using the command line:

cscript //nologo SetDefaultPrinter.js

...or you could just save it to your desktop and double-click to run it.

share|improve this answer
add comment

One option would be something like this to automatically switch your printer based on IP address. It presumably could switch to none when you're at home.

share|improve this answer
add comment

It might help to change your default printer to one that is defined locally.

There isn't an obvious (to me at least) rational reason for an application to interact with a printer when changing a font style, but if that is what is happening then at least a local printer won't be across an unconnected network.

share|improve this answer
    
I don't have a local printer and I really like the fact I have my default printer defined as the work one (I print a lot) –  Roee Adler Aug 30 '09 at 17:58
add comment

You could add a procedure to the ThisWorkbook/ThisDocument module of your personal.xls/normal.dot that would detect if you were at home and set the printer default appropriately.

I've not tested this, but USERDOMAIN (index 30) should be suitable for this purpose. The following code should give you a rough idea of what is required to do this.

Sub checkDomain()
    Dim desiredPrinter As String

    If Environ(30) = "USERDOMAIN=YOURWORKDOMAIN" Then
        'Set work default printer
        desiredPrinter = "\\NetworkAddress\Work Printer on Ne04:"
    Else
        'Set home default printer
        desiredPrinter = "Microsoft XPS Document Writer on Ne01:"
    End If

    If Not Application.ActivePrinter = desiredPrinter Then
        Application.ActivePrinter = desiredPrinter
    End If
End Sub

Note that the ports will likely be different on your PC, you can run the following code to check what VBA thinks your printers are called.

Sub PrinterList()
    Dim objWMIService
    Dim colInstalledPrinters
    Dim objPrinter
    Dim strPrinterName As String
    Dim strComputer As String

    strPrinterName = Application.ActivePrinter
    strComputer = "."
    Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
    Set colInstalledPrinters = objWMIService.ExecQuery("Select * from Win32_Printer ")

    For Each objPrinter In colInstalledPrinters
        If objPrinter.PrinterStatus = 1 Or objPrinter.PrinterStatus = 2 Or objPrinter.PrinterStatus =     7 Then
            Debug.Print "offline:" & objPrinter.Name
        Else
            If InStr(strPrinterName, objPrinter.Name) Then
                Debug.Print objPrinter.Name & "*"
            Else
                Debug.Print objPrinter.Name
            End If
        End If
    Next
End Sub

This will list all installed printer names in the Immediate window of the Visual Basic Editor (CTRL+G for the Immediate window if you're not very familiar with VBA)

share|improve this answer
add comment

Whilst you can check the ActivePrinter property in Excel 2007, you can't set it for some reason (even though you can in a Word VBA script). Here's the workaround in Excel VBA:

Set oWord = CreateObject(Class:="Word.Application")

oWord.ActivePrinter = NewDefaultPrinter$

oWord.Quit False

Set oWord = Nothing

It is especially useful to change the default printer if it's currently set to a network printer, as delays are experienced if the VBA macro modifies a workbook (delete columns etc) - it seems to check on the printer with each change made. To prevent this the default printer needs to be set to a local printer during the workbook modification process, then back again afterwards.

share|improve this answer
add comment

Another solution is to simply disable the display of page breaks on the slow tab(s). You can see an example of this here: http://blogs.mccombs.utexas.edu/the-most/2010/02/17/hidepagebreaks/

The print communication is often because Excel is trying to constantly repaginate your sheet, which is expensive and generally unnecessary. I have seen good performance improvements by simply disabling that option.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.