Visual Basic Explorer
Visual Basic Explorer
 Navigation
 Home


 Coding
 Source Code

 FAQ Center

 VB Tips

 Downloads

 ToolBox

 Tutorials

 VB Games

 VB News

 VB Award

 VB Forums



 Affiliates
 Planet Source Code

 Rent a Coder

 DirectX4VB


 Misc
 Search

 Feedback

 Advertise

 About


Need to hire
a VB coder?

Please support our sponsor:

 Home 
 Site Map 
 Forums 
 News 
 Feedback 

 

Q. How to activate cancel button in dialog box?

 
How do I assign the cancel property to the cancel button of
a simple dialog box? I`ve written a macro in Excel using VB
and use dialog box inputs to get user data. However, hitting
the cancel button during data entry has no effect.

 
A. What you have to do is set CancelError = True

 
This means that if the user presses Cancel it causes an
error - so then you set up an error trap to do what ever
you want when the error happens. Look in the help file to
get the exact syntax but it is something like this:

 
'Pseudo code
on error goto errortrap ... ... ...
'all your stuff here ... ... ...
exit sub

 
errortrap:
if err=32755 then
'that might not be the right value, you can look up the error
'codes in the help file.
end if
end sub

(08-Aug-98 Dan Pupius danp600@aol.com)


Downloads

In IE right-click and select 'Save Target As...' or in Netscape right-click and select 'Save Link As...'

 

View Plain Text View Plain Text
Download Demo Project Not Available
View Code Online Not Available





Home | About | What's New | Source Code | FAQ | Tips & Tricks | Downloads | ToolBox | Tutorials | Game Programming | VB Award | Search | VB Forums | Feedback | VBNews | Copyright & Disclaimer | Advertise | Privacy Policy |

Quick searches: Site Search | Advanced Site Search 

Copyright 2002 by Exhedra Solutions, Inc.
By using this site you agree to its terms and conditions
VB Explorer and VBExplorer.com are trademarks of Exhedra Solutions, Inc.