View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Jim Cone Jim Cone is offline
external usenet poster
 
Posts: 3,290
Default Excel 2002/Windows XP - PageSetup error

Matt,

You are ahead of me, as you have already tested it
using a string only. So it shouldn't be the userID that is
causing the problem.
As a temporary? crutch, you could put an on error resume next
statement in the code. The printout without a name would
belong to the computer with the problem.

You might want to check if it will work if you put the
code into the Workbook_BeforePrint event.

Also, for what's it worth, I normally use the Excel property...
"Application.UserName" to identify worksheet print outs.
Doubt if I can contribute anything more to this.

Regards,
Jim Cone
San Francisco, USA


wrote in message
oups.com...
Hi Jim,
To answer your questions:
-No chart sheets in the workbook, just spreadsheets.
-It's not quite a simple string as it does include some formatting and
a call to a function that retrieves the user's network ID (can be found
by googling "fOSUserName", that's how I found it a couple of years
ago).
If this is important I can post the details (the fOSUserName function,
and the exact string I'm setting the header to) from the office
tomorrow as I don't have them handy here at home. However, among the
things I tested when I was able to use the machine where the error
occurred was replacing the header text with a simple string, and the
same error occurred when the VBA code tried to set the RightHeader.
For what it's worth I was also able to test using my own ID and another
employee's ID (I have write access on the directory where the workbook
is housed, most other users have read-only access because they're not
saving the workbook, just using the spreadsheets, printing, and
closing). Again, no effect -- a computer generating the error for one
user ID generated it for both, and a computer not generating the error
was fine for both IDs.
Basically, I'm putting the individual user's network ID in the print
header because there are many people using these spreadsheets and they
sometimes have trouble separating out their own printouts when several
pile up on the printer.
Thanks for your consideration!
Matt