Excel Intermittent print crashing

H

hall.jeff

A client of ours is using our excel software and is having vaguely
random (but frequent) crashes during print.

I believe that the problem is related to corrupt or erroneous metafile
data.

1) Problem occurs at print time (we've tracked the crashing down to
the actual print command)
2) Stepping through the code makes the problem not happen
3) Inserting "Do Events" immediately before and after the error does
NOT fix the problem
4) The problem is isolated to specific users who always have access to
a weird printer. The problem persists even when they don't use said
printer
5) The problem may or may not have something to do with footers that
we dynamically add (via VBA code)
6) The problem persists to other users IF (and only if) they print the
files directly out of email (have not tested printing directly off the
network). If the files are saved FIRST and then printed then the error
does not occur. NOTE: Savings first does not necessarily fix the
problems for the primary error individual.
7) Opening and savings a file from the primary error individual
results in a somewhat drastic file size decrease (generally >10%)
8) The problem GENERALLY occurs with larger spreadsheets but not
always

Taken altogether, I believe that the file must save metadata for each
printer it CAN print to.... As a result of the weird printer, there is
bad metadata that gets used that can't be passed to the final printer.

My questions then are: How can I confirm my hypothesis? If I turn out
to be right, what the heck do I do?
 
D

Dave Peterson

You may want to test another theory.

Maybe it's the printer (printer/driver) that's causing the trouble.

Does it still blow up if you change printers, using a different printer driver?
 
H

hall.jeff

yes it does... but both people with the problem still HAVE the other
printer driver...

what we're trying to do today is to blow away the old driver, print to
a new printer and see if the problem persists

I hate non-reproducable, intermittent bugs.
 
H

hall.jeff

for what it's worth, the printing error appears to not occur when you
print preview first and then print from there... commenting out this
code in VBA also worked:

For Each sht In wb.Worksheets
If sht.Visible Then
sht.PageSetup.LeftFooter = "&""""&8" & wb.FullName
End If
Next sht

however, reimplementing the code and setting a break point AFTER this
actually gets through the code fine (i.e. that code executes
properly)... I'm wondering if the quad quotes aren't some sort of bud
in certain printers? (although it does still print out fine after a
preview)
 
D

Dave Peterson

I wouldn't think that any printer would find anything wrong in that string.

But I don't have another guess.
 
H

hall.jeff

the string actually resolves to this

&""&8 blahblahblah

what this is telling excel is &"" (use the current font), &8 (use 8
point font). After playing around with it, we've come to the
conclusion that the leading &"" is wholly unnecessary and we only used
it because it was the example in the book we were using. We're going
to try removing this and seeing if that doesn't fix the problem. Our
working theory is that excel is passing incomplete information to the
printer because it is not resolving &"" quick enough. By forcing it to
print preview, we force it to figure out &"" prior to passing the
information to the printer... Identifying when or what causes this is
a mystery (slow network connection, slow computer ?) but we have high
hopes that this will work (it works on our internal testing but that
wasn't broken before ;)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top