Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 104
Default error trapping

Hi all,

I have just used error trapping for the first time and i am having some
problems with it. here it is

sub test()

on error goto errortrap
Unload Me


Sheets("codes").Select

UserForm1.Show

errortrap:

unload me
userform7.show


if there an error i wish to display another userform, however at the
moment if theres no error the program will run but still display the
userform7 at the end of the program instead of ignoring it, any help
greatly accepted

regards

johny

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 184
Default error trapping

Hi, think you want to exit the sub before userform7.show is executed.
Then if there is an error, I believe that it will go to your
errortrap:, which will then show userform7.

sub test()
on error goto errortrap
Unload Me

Sheets("codes").Select

UserForm1.Show

exit sub
errortrap:

unload me
userform7.show

exit sub

Good luck--Lonnie

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
Error Trapping from WSH Tom Chau Excel Discussion (Misc queries) 1 August 25th 06 04:21 AM
Error trapping Luis Excel Programming 1 November 11th 04 03:25 AM
trapping error RobcPettit Excel Programming 2 January 30th 04 03:37 AM
Error Trapping Neil Excel Programming 1 January 5th 04 04:38 PM
error trapping libby Excel Programming 5 November 25th 03 10:57 PM


All times are GMT +1. The time now is 08:57 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"