Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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" wrote in message
oups.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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default 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" wrote in message
oups.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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Change in Column Width depending on whether printer is installed / SLK Excel Discussion (Misc queries) 1 May 9th 08 05:53 PM
Getting "printer not installed" when trying to edit page setup jac Excel Worksheet Functions 1 March 5th 05 07:19 PM
Changing Excel Object's page setup wthout having a printer installed alijaffer Excel Programming 3 July 27th 04 05:03 PM
Excel crashes when .Net framework installed Ed Vance Excel Programming 0 December 22nd 03 06:26 PM
macro crashes excell xp Todd[_5_] Excel Programming 2 September 5th 03 07:10 PM


All times are GMT +1. The time now is 08:50 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"