Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default How to Write Error Trap

I have the following code to toggle between print preview and normal
view but I need to add an error statement just in case there is no
sheet open.

Can someone please suggest how I might write this.

Thanks

Sub TogglePrintView()

If ActiveWindow.View = xlPageBreakPreview Then
ActiveWindow.View = xlNormalView
ElseIf ActiveWindow.View = xlNormalView Then
ActiveWindow.View = xlPageBreakPreview
End If
End Sub
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
How to Write Error Trap GavinS Excel Programming 24 June 5th 09 04:29 AM
Set Error handling INSIDE error-trap Michelle Excel Programming 6 May 3rd 08 03:30 PM
Need error trap GregR Excel Programming 4 June 14th 07 08:28 PM
Error Handling - On Error GoTo doesn't trap error successfully David Excel Programming 9 February 16th 06 05:59 PM
Error Trap Kirk P. Excel Programming 2 September 8th 05 09:51 PM


All times are GMT +1. The time now is 04:27 AM.

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

About Us

"It's about Microsoft Excel"