Results 1 to 6 of 6
  1. #1
    Star Lounger
    Join Date
    Mar 2001
    Location
    Ontario, Canada
    Posts
    57
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Office SP3 clobbers fullname footer macro (O2K)

    I've had a beforeprint macro running for a number of years, based on code gathered in this forum. It resides in my personal.xls. A week ago my employer's IS department deployed Office SP3 and since then the macro doesn't work any more. On my PC it comes up with an error message (run time error 50290 - method Fullname of object '_workbook' failed". On some other PCs it runs but prints out a blank name. I've tried using both Activeworkbook.Fullname and Thisworkbook.fullname - both cause problems. One co-worker who hasn't had SP3 deployed to his PC is still doing fine.

    Any ideas why SP3 has clobbered this property?? Thanks for your help.

  2. #2
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Vienna, Wien, Austria
    Posts
    5,009
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Office SP3 clobbers fullname footer macro (O2K

    Can you copy your code into a text file and attach it to your next post?
    Gre

  3. #3
    Star Lounger
    Join Date
    Mar 2001
    Location
    Ontario, Canada
    Posts
    57
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Office SP3 clobbers fullname footer macro (O2K)

    Here you go. As I said, it's in the eventclass module of my personal.xls.

    Option Explicit

    Public WithEvents App As Application


    Private Sub App_WorkbookBeforePrint(ByVal Wb As Excel.Workbook, Cancel As Boolean)
    Dim wbkname As String
    With ActiveWorkbook
    wbkname = .Name
    If .Author = "" Then
    .Author = Application.UserName
    End If
    End With
    If UCase(Mid(wbkname, 1, 4)) = "BOOK" Then
    MsgBox ("Please save before printing")
    Application.Dialogs(xlDialogSaveAs).Show
    End If
    With ActiveSheet.PageSetup
    .LeftFooter = "&09" & ActiveWorkbook.FullName & "[&A]" & Chr(10) & Application.UserName & " " & "&D" & " " & "&T"
    ' .LeftHeader = " "
    ' .CenterHeader = " "
    ' .RightHeader = " "
    .CenterFooter = " "
    .RightFooter = " "
    End With
    End Sub

    Private Sub Class_Initialize()

    End Sub

  4. #4
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Vienna, Wien, Austria
    Posts
    5,009
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Office SP3 clobbers fullname footer macro (O2K

    I have run ThisWorkbook.FullName code on SP3 many times without any problems. This makes me wonder whether there's another variable in operation. I do take it that SP3 is the _only_ thing that was installed when your machine was upgraded. Are you working in a Document Management System environment?
    Gre

  5. #5
    Star Lounger
    Join Date
    Mar 2001
    Location
    Ontario, Canada
    Posts
    57
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Office SP3 clobbers fullname footer macro (O2K

    The log file tells me that the following were all installed at the same time:

    Office SP3 with security patches MS03-035,036,037,050. I'm not sure what you mean by a Document Management System environment. Our patches get installed overnight over the LAN using SMS.

    I've narrowed the problem down a bit. It only seems to happen in print preview. I can open Excel and print anything and it'll work, but once I do a print preview my goose is cooked until I exit from Excel and come back in again.

  6. #6
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Vienna, Wien, Austria
    Posts
    5,009
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Office SP3 clobbers fullname footer macro (O2K

    There is a post SP3 hotfix for Print Preview issues, but this applies to machines linked to SharePoint, and so it doesn't seem to be in point for you.

    Personally, I tend to use Page Break Preview (and, if necessary, the Page Setup dialog) - rather than Print Preview. This may not make an elegant workaround, but I hope it helps.
    Gre

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •