+ Reply to Thread
Results 1 to 3 of 3

Macro crashes if printer not installed

  1. #1
    Phil
    Guest

    Macro crashes if printer not installed

    I am using the following code to add a footer to a page:

    ActiveSheet.PageSetup.RightFooter = "&8&F" & Chr(10) & "&A" & Chr(10) &
    "&D"

    The problem is that the macro crashes on a computer that does not have
    a printer installed. Can anyone please suggest a way to handle this?


  2. #2
    Tom Ogilvy
    Guest

    Re: Macro crashes if printer not installed

    You can assign/configure a print driver even though you don't actually
    connect a printer to the computer. You then select that in your print
    setup.

    --
    Regards,
    Tom Ogilvy

    "Phil" <plmcelwee@yahoo.com> wrote in message
    news:1105720265.958796.301160@z14g2000cwz.googlegroups.com...
    > I am using the following code to add a footer to a page:
    >
    > ActiveSheet.PageSetup.RightFooter = "&8&F" & Chr(10) & "&A" & Chr(10) &
    > "&D"
    >
    > The problem is that the macro crashes on a computer that does not have
    > a printer installed. Can anyone please suggest a way to handle this?
    >




  3. #3
    Bob Phillips
    Guest

    Re: Macro crashes if printer not installed

    I don't have a machine without a printer driver, so I can't test it, but you
    could try wrapping it with error handling

    On Error Goto no_printer
    ...

    no_printer:
    Msgbox "No printer installed"

    --
    HTH

    Bob Phillips

    "Phil" <plmcelwee@yahoo.com> wrote in message
    news:1105720265.958796.301160@z14g2000cwz.googlegroups.com...
    > I am using the following code to add a footer to a page:
    >
    > ActiveSheet.PageSetup.RightFooter = "&8&F" & Chr(10) & "&A" & Chr(10) &
    > "&D"
    >
    > The problem is that the macro crashes on a computer that does not have
    > a printer installed. Can anyone please suggest a way to handle this?
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1