几何尺寸与公差论坛

 找回密码
 注册
查看: 905|回复: 0

【转帖】make x button exit macro

[复制链接]
发表于 2009-4-12 21:44:01 | 显示全部楼层 |阅读模式
make x button exit macro ?
hi,
i just stumbled across something a little annoying to me. the x button in the top right corner of a form does not exit the macro it just exits the form and continues to run the rest of the macro. can you make the the button exit the macro ? i know i could just make a cancel button but i am just wondering if it works.
thanks.
solidworks 2006,2007,2008,2009 (office premium.)
core 2 duo e6850 @ 3.00 mhz
window xp pro sp3 32 bit
ati firegl v7350
answer you should be able to use the terminate procedure. when you are programming in your code for your form there are two dropdown lists at the top of the dialog box. the one one the left may say userform if not dropdown the list and pick "userform". in the dropdown on the right choose "terminate." this will create a sub called terminate. enter your end code in that sub.
hope this works
dan miel
thanks i guess that is simple enough.
solidworks 2006,2007,2008,2009 (office premium.)
core 2 duo e6850 @ 3.00 mhz
window xp pro sp3 32 bit
ati firegl v7350
originally posted by: dan miel
you should be able to use the terminate procedure. when you are programming in your code for your form there are two dropdown lists at the top of the dialog box. the one one the left may say userform if not dropdown the list and pick "userform". in the dropdown on the right choose "terminate." this will create a sub called terminate. enter your end code in that sub.
hope this works
dan miel
if using only vba, this doesn't work well.
matt lorono
solidworks 2007 sp3.1
cad engineer/ecn analyst
hi matt,
what would you suggest then ?
solidworks 2006,2007,2008,2009 (office premium.)
core 2 duo e6850 @ 3.00 mhz
window xp pro sp3 32 bit
ati firegl v7350
disable the x button and include a cancel button on the form.
originally posted by: dominic cozzitorto
disable the x button and include a cancel button on the form.
yup, this is what i do. sorry for responding late.
matt lorono
solidworks 2007 sp3.1
cad engineer/ecn analyst
thanks
solidworks 2006,2007,2008,2009 (office premium.)
core 2 duo e6850 @ 3.00 mhz
window xp pro sp3 32 bit
ati firegl v7350
what do i need to do to disable to the x button in vba then?
drc inc.
minneapolis, mn
.designreadycontrols.com
sw2007 sp5.0
core2 quad
3gb ram
xp pro sp2
ati firegl v3600
originally posted by: john bjerke
what do i need to do to disable to the x button in vba then?
if no one else gets to answer this today, i'll post the answer a bit later. it requires particular code.
matt lorono
solidworks 2007 sp3.1
cad engineer/ecn analyst
your problem is just that the macro will run until it reaches the end of the main function, so showing/hiding a form has no effect on this unless say you show a form modal and the line after that is the end of the main() function.
you are best uploading your code or posting an example to see where you are going wrong in the design phase and we can solve the problem instead of working around it.
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|小黑屋|几何尺寸与公差论坛

GMT+8, 2024-12-23 15:16 , Processed in 0.035934 second(s), 19 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表