Blocking X button in UserForm

Many times I’ve wrote applications, where top right X button had to be disabled. Code has been borrowed from Johna Walkenbach.

When user clicks UserForm “X” button then Msgbox appears. Code for Msgbox:

MsgBox "To close this window please click START lub CLOSE.", vbInformation, "ERRROR..."

Please notice that MsgBox says that in UserForm there are two more button such as START and CLOSE. These buttons have to be added to UserForm with code to close Userform this is Unload Me.

Following code has to pasted in UserForm area, in UserForm area where we want to block right top X button:

Private Sub UserForm_QueryClose _
(Cancel As Integer, CloseMode As Integer)
    If CloseMode = vbFormControlMenu Then
      MsgBox "To close this window please click START lub CLOSE.", vbInformation, "ERRROR..."
      Cancel = True
    End If
End Sub

356 thoughts on “Blocking X button in UserForm

  1. Rebuilded solution. UserForm_QueryClose working together with UserForm_Terminate

    Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
    ' Disable UserForm "X"  button,
    
    If CloseMode = vbFormControlMenu Then
        If MsgBox("Are you really shut down app?", vbYesNo + vbQuestion, "CLOSE...") = vbYes Then
            Call UserForm_Terminate
        Else
            ' vbNO, nothing happened
            Cancel = True
        End If
    End If
    End Sub
    
  2. Pingback: qiuqiu99

  3. Pingback: mơ thấy anh em gặp nhau

  4. Pingback: Parrots for Sale

  5. Pingback: australian labradoodle puppies for sale

  6. Pingback: Keltecs

  7. Pingback: SSCN BKN 2021 Kabupaten Muna Barat

  8. Pingback: mơ rắn cắn đánh đề bao nhiêu

  9. Pingback: Best CVV Sites

  10. Pingback: sex dolls shop

  11. Pingback: 12ga Shotgun

  12. Pingback: nằm mơ thấy rắn hổ mang

  13. Pingback: mơ thấy gấu đánh con gì

  14. Pingback: mo thay an bap

  15. Pingback: satta king

  16. Pingback: dơi bay vào nhà tốt hay xấu

  17. Pingback: nam mo thay gay rang

  18. Pingback: mơ thấy thỏ trắng

  19. Pingback: tor search

  20. Pingback: pasarqq

  21. Pingback: Stiiizy flavors

  22. Pingback: mơ bị đòi nợ

  23. Pingback: giải mã giấc mơ gặp người yêu cũ

  24. Pingback: mơ mất xe đạp đánh con gì

  25. Pingback: panzer bp12

  26. Pingback: mơ thấy đi chùa lạy phật

  27. Pingback: bai cat te

  28. Pingback: choi game doi thuong tren may tinh

  29. Pingback: mơ thấy đứt tay chảy máu

  30. Pingback: mơ thấy quả bưởi đánh con gì

  31. Pingback: nằm mơ thấy đi chùa

  32. Pingback: mơ thấy chuối xanh

  33. Pingback: mơ rụng tóc đánh con gì

  34. Pingback: tangerine sign in

  35. Pingback: dumps cc

  36. Pingback: realcouchtuner.com

  37. Pingback: do you need a driving license to buy a car uk

  38. Pingback: ตู้แปลภาษา

  39. Pingback: นิยาย pdf

  40. Pingback: nam mo thay giet nguoi

  41. Pingback: mơ bị sét đánh

  42. Pingback: mơ thấy tàu hỏa

  43. Pingback: www.bilskrotgbg.se

  44. Pingback: mơ thấy lợn đẻ

  45. Pingback: mơ thấy nhà đánh con gì

  46. Pingback: nằm mơ thấy đầu người

  47. Pingback: rapid rewards promo code 2017

  48. Pingback: 토토사이트 추천

  49. Pingback: 메이저놀이터

  50. Pingback: cpnsaubs

  51. Pingback: how safe is viagra

  52. Pingback: welke landen is viagra vrij verkrijgbaar

  53. Pingback: how many mg of zithromax to cure chlamydia

  54. Pingback: cialis

  55. Pingback: viagra no prescription

  56. Pingback: comprar viagra online contrareembolso

  57. Pingback: federal resume writing service

  58. Pingback: research writing

  59. Pingback: write my essay for me online

  60. Pingback: help me write an apa essay

  61. Pingback: amoxicillin 75 mg

  62. Pingback: how much is furosemide 20mg

  63. Pingback: zithromax prescription cost

  64. Pingback: stromectol in canada

  65. Pingback: order ventolin from canada no prescription

  66. Pingback: acne medication doxycycline

  67. Pingback: prednisolone acetate ophthalmic

  68. Pingback: is clomid legal

  69. Pingback: priligy tablets walmart

  70. Pingback: diflucan iv dose

  71. Pingback: synthroid vs armour

  72. Pingback: propecia wikipedia

  73. Pingback: neurontin and fibromyalgia

  74. Pingback: contraindications of metformin

  75. Pingback: paxil for dogs

  76. Pingback: plaquenil allergic rash

  77. Pingback: safe buy cialis

  78. Pingback: cost of tadalafil without insurance

  79. Pingback: cialis walmart

  80. Pingback: original for sale

  81. Pingback: online payday loan dearborn heights

  82. Pingback: sildenafil citrate 20 mg how fast does it work

  83. Pingback: retin a from canadian pharmacy

  84. Pingback: stromectol

  85. Pingback: how to know who liked you on tinder

  86. Pingback: advance america cash advance coon rapids

  87. Pingback: cialis without a doctor prescription

  88. Pingback: buy 36 hour

  89. Pingback: buy 36 hour

  90. Pingback: dating chat line free trial

  91. Pingback: buy ativan fast shipping

  92. Pingback: best price for tadalafil 20 mg

  93. Pingback: fildena pills

  94. Pingback: super fildena 100

  95. Pingback: generic cialis at walmart

  96. Pingback: buy tadalafil online

  97. Pingback: pure dating site gay straight

  98. Pingback: purchase amoxil usa

  99. Pingback: lasix generic cost

  100. Pingback: neurontin online

  101. Pingback: plaquenil buy online

  102. Pingback: prednisone buy

  103. Pingback: how to get priligy

  104. Pingback: buy modafinil 200 mg

  105. Pingback: ivermectin 500ml

  106. Pingback: drug albuterol pills

  107. Pingback: zithromax 250

  108. Pingback: plaquenil and vision

  109. Pingback: deltasone 20 mg price

  110. Pingback: where to get priligy

  111. Pingback: tadalafil generic price

  112. Pingback: viagra sex

  113. Pingback: ivermectin and covid

  114. Pingback: bimatoprost 0.03

  115. Pingback: olumiant 2 mg

  116. Pingback: aralen

  117. Pingback: lumigan walmart

  118. Pingback: Anonymous

  119. Pingback: nolvadex 25mg

  120. Pingback: 100 mg clomid

  121. Pingback: Anonymous

  122. Pingback: Anonymous

  123. Pingback: ivermectin for humans

  124. Pingback: cost of ivermectin

  125. Pingback: ivermectin where to buy

  126. Pingback: ignition casino how to cash out

  127. Pingback: ivermectin tablets for sale

  128. Pingback: ivermectin for humans

  129. Pingback: prednisone 20mg price

  130. Pingback: buy tadalafil online

  131. Pingback: ivermectin cream 1

  132. Pingback: where can i buy oral ivermectin

  133. Pingback: buy viagra brighton

  134. Pingback: tadalafil india

  135. Pingback: generic viagra for daily use

  136. Pingback: lasix without prescriptions

  137. Pingback: ivermectin resistance

  138. Pingback: where can i buy cialis tablets

  139. Pingback: cheapest tadalafil cost

  140. Pingback: price of cialis in eu

  141. Pingback: order cialis from india online

  142. Pingback: sildenafil pills

  143. Pingback: order tadalafil online

  144. Pingback: order stromectol

  145. Pingback: sildenafil citrate

  146. Pingback: cialis with dapoxetine

  147. Pingback: generic tadalafil india

  148. Pingback: can you buy generic cialis in canada

  149. Pingback: buying prednisone online

  150. Pingback: generic prednisone 20mg

  151. Pingback: buy molnupiravir

  152. Pingback: best cialis discount

  153. Pingback: tadalafil cialis

  154. Pingback: stromectol 3 mg tablet

  155. Pingback: side effects of prednisone in humans

  156. Pingback: can i buy viagra

  157. Pingback: generic cialis

  158. Pingback: real money gambling

  159. Pingback: natural viagra for men

  160. Pingback: when to take viagra

  161. Pingback: canada cialis generic online

  162. Pingback: theborgata com login

  163. Pingback: ivermectin without prescription

  164. Pingback: tadalafil cialis

  165. Pingback: ivermectin structure

  166. Pingback: online gambling slots

  167. Pingback: ivermectin bnf

  168. Pingback: how to get rid of acne scars whhile on accutane

  169. Pingback: sildenafil over the counter

  170. Pingback: cialis online pharmacy

  171. Pingback: tadalafil liquid

  172. Pingback: zithromax burning

  173. Pingback: ivermectin powder

  174. Pingback: free slots win money instantly

  175. Pingback: ivermectin 12 mg online

  176. Pingback: ivermectin tablet online

  177. Pingback: ivermectin kaufen deutschland

  178. Pingback: buy ivermectin online

  179. Pingback: molnupiravir vs ivermectin

  180. Pingback: purchase stromectol online

  181. Pingback: zithromax mg

  182. Pingback: keflex synonym

  183. Pingback: generic

  184. Pingback: stromectol uk buy

  185. Pingback: clindamycin taste

  186. Pingback: omnicef uti

  187. Pingback: ciprofloxacin 500mg

  188. Pingback: ivermectin 3mg

  189. Pingback: ivermectin 3 mg tablets for humans for sale

  190. Pingback: ivermectin 5 mg

  191. Pingback: lasix uk

  192. Pingback: generic furosemide 20 mg

  193. Pingback: how much is ivermectin

  194. Pingback: ivermectin usa price

  195. Pingback: horse paste ivermectin

  196. Pingback: tadalafil pills

  197. Pingback: ivermectin for sale humans

  198. Pingback: ivermectin canada

  199. Pingback: stromectol

  200. Pingback: cialis manufacturer

  201. Pingback: luckyland slot

  202. Pingback: fda ivermectin

  203. Pingback: https://swerbus.webgarden.com/

  204. Pingback: gerweds.over-blog.com202203modeling-covid-19-mortality-risk-in-toronto-canada-sciencedirect.html

  205. Pingback: stromectol 3 mg

  206. Pingback: stromectol 3 mg tablet

  207. Pingback: keuybc.estranky.skclanky30-facts-you-must-know--a-covid-cribsheet.html

  208. Pingback: canada pharmacies online

  209. Pingback: telegra.phIs-It-Safe-To-Lift-COVID-19-Travel-Bans-04-06

  210. Pingback: where can you buy ivermectin

  211. Pingback: are frontline workers taking hydroxychloroquine

  212. Pingback: graph.orgThe-Way-To-Get-Health-Care-At-Home-During-COVID-19---Health--Fitness-04-07

  213. Pingback: chubo3.wixsite.comcanadian-pharmacypostwhat-parents-must-find-out-about-kids-and-covid-19

  214. Pingback: Canadian Pharmacies Shipping to USA

  215. Pingback: https://pharmacy-online.yolasite.com/

  216. Pingback: kevasw.webgarden.com

  217. Pingback: https://62553dced4718.site123.me/

  218. Pingback: cialis price at walmart

  219. Pingback: https://seketu.gonevis.com/high-10-tips-with-order-medicine-online-1/

  220. Pingback: canadian discount pharmacies

  221. Pingback: 625a9a98d5fa7.site123.meblogage-dependence-of-healthcare-interventions-for-covid-19-in-ontario-canada

  222. Pingback: https://hernswe.gonevis.com/scientists-model-true-prevalence-of-covid-19-throughout-pandemic/

  223. Pingback: https://selomns.gonevis.com/a-modified-age-structured-sir-model-for-covid-19-type-viruses/

  224. Pingback: ivermectin tablets walmart

  225. Pingback: ivermectin india

  226. Pingback: ivermectina

  227. Pingback: buy cheap cialis in canada

  228. Pingback: trosorin.mystrikingly.com

  229. Pingback: sasnd0.wixsite.comcialispostimpotent-victims-can-now-cheer-up-try-generic-tadalafil-men-health

  230. Pingback: buy stromectol online

  231. Pingback: buy cialis with no prescription

  232. Pingback: buy tadalafil online

  233. Pingback: buy cialis online us pharmacy

  234. Pingback: walmart pharmacy

  235. Pingback: https://skuvsbs.gonevis.com/when-tadalafil-5mg-competitors-is-good/

  236. Pingback: hemuyrt.livejournal.com325.html

  237. Pingback: buy tadalafil pills

  238. Pingback: buy cialis without a doctor's prescription

  239. Pingback: ghswed.wordpress.com20220427he-final-word-information-to-online-pharmacies

  240. Pingback: canadian pharmaceuticals

  241. Pingback: kuebser.estranky.skclankysupereasy-methods-to-study-every-part-about-online-medicine-order-discount.html

  242. Pingback: prescriptions from canada without

  243. Pingback: kerbiss.wordpress.com2022042714

  244. Pingback: heswcxc.wordpress.com20220430online-medicine-tablets-shopping-promotion-one-hundred-and-one

  245. Pingback: drugstore online

  246. Pingback: https://kertubs.mystrikingly.com/

  247. Pingback: https://626f977eb31c9.site123.me/blog/how-google-is-changing-how-we-approach-online-order-medicine-1

  248. Pingback: list of reputable canadian pharmacies

  249. Pingback: canada viagra

  250. Pingback: buy viagra usa

  251. Pingback: Canadian Pharmacies Shipping to USA

  252. Pingback: kertyun.flazio.com

  253. Pingback: canadian pharmacies mail order

  254. Pingback: kerbnt.flazio.com

  255. Pingback: otc ivermectin

  256. Pingback: http://nanos.jp/jmp?url=http://cialisonlinei.com/

  257. Pingback: ime.nucialisonlinei.com

  258. Pingback: womed7.wixsite.compharmacy-onlinepostnew-ideas-into-canada-pharmacies-never-before-revealed

  259. Pingback: hydroxychloroquine online

  260. Pingback: online pharmacy

  261. Pingback: canadian online pharmacies

  262. Pingback: online pharmacies canada

  263. Pingback: https://pharmacy-online.webflow.io/

  264. Pingback: online canadian pharmacy

  265. Pingback: site273035107.fo.team

  266. Pingback: https://site656670376.fo.team/

  267. Pingback: site561571227.fo.team

  268. Pingback: canadian pharmaceuticals online

  269. Pingback: https://hekluy.ucraft.site/

  270. Pingback: canadian government approved pharmacies

  271. Pingback: madridbet

  272. Pingback: meritroyalbet

  273. Pingback: https://hertnsd.nethouse.ru/

  274. Pingback: meritroyalbet

  275. Pingback: canada rx

  276. Pingback: eurocasino

  277. Pingback: canadian rx world pharmacy

  278. Pingback: avuiom.sellfy.store

  279. Pingback: pharmacies.bigcartel.com

  280. Pingback: online pharmacy

  281. Pingback: canadian pharmacy meds

  282. Pingback: can you buy hydroxychloroquine over the counter in canada

  283. Pingback: canadian pharmaceuticals online

  284. Pingback: https://lasert.gonevis.com/recommended-canadian-pharmacies-2/

  285. Pingback: canadian drugs

  286. Pingback: northwestpharmacy

  287. Pingback: https://asebg.bigcartel.com/canadian-pharmacy

  288. Pingback: medicine-online.estranky.skclankyunderstand-covid-19-and-know-the-tricks-to-avoid-it-from-spreading-----medical-services.html

  289. Pingback: northwest pharmacies

  290. Pingback: tadalafil generic usa

  291. Pingback: canada viagra

  292. Pingback: canadian pharmacies without an rx

  293. Pingback: kewburet.wordpress.com20220427how-to-keep-your-workers-healthy-during-covid-19-health-regulations

  294. Pingback: https://kaswesa.nethouse.ru/

  295. Pingback: canada drugs online

  296. Pingback: meritroyalbet

  297. Pingback: stromectol order

  298. Pingback: canadian-pharmaceutical.webflow.io

  299. Pingback: buy stromectol 3 mg

  300. Pingback: pamelaliggins.website2.me

  301. Pingback: slovar po psihoanalizu laplansh

  302. Pingback: pharmacy.prodact.site

  303. Pingback: no 1 canadian pharcharmy online

  304. Pingback: uels ukrain

  305. Pingback: hertb.mystrikingly.com

  306. Pingback: best canadian mail order pharmacies

  307. Pingback: https://selera.mystrikingly.com/

  308. Pingback: https://ksorvb.estranky.sk/clanky/why-online-pharmacies-is-good-friend-to-small-business.html

  309. Pingback: gevcaf.estranky.czclankysafe-canadian-online-pharmacies.html

  310. Pingback: kwersv.proweb.cz

  311. Pingback: ivermectin ingredients

  312. Pingback: https://kwervb.estranky.cz/clanky/canadian-government-approved-pharmacies.html

  313. Pingback: bahis siteleri

  314. Pingback: DPTPtNqS

  315. Pingback: qQ8KZZE6

  316. Pingback: D6tuzANh

  317. Pingback: SHKALA TONOV

  318. Pingback: Øêàëà òîíîâ

  319. Pingback: russianmanagement.com

  320. Pingback: chelovek-iz-90-h

  321. Pingback: sdtyli.zombeek.cz

  322. Pingback: https://kwsde.zombeek.cz/

  323. Pingback: 3Hk12Bl

  324. Pingback: 3NOZC44

  325. Pingback: buy viagra 25mg

  326. Pingback: 01211

  327. Pingback: tor-lyubov-i-grom

  328. Pingback: film-tor-2022

  329. Pingback: hd-tor-2022

  330. Pingback: iercvsw.wordpress.com20220614canadian-pharmacies-the-fitting-manner

  331. Pingback: intermectine

  332. Pingback: Psikholog

  333. Pingback: netstate.ru

  334. Pingback: https://site955305180.fo.team/

  335. Pingback: Link

  336. Pingback: 2decision

  337. Pingback: stromectol coronavirus

  338. Pingback: ivermectin 12

  339. Pingback: buying ivermectin

  340. Pingback: site841934642.fo.team

  341. Pingback: 62b2f636ecec4.site123.meblogcanadian-pharmaceuticals-online

  342. Pingback: legitimate canadian mail order pharmacies

  343. Pingback: tor-lyubov-i-grom.ru

  344. Pingback: psy

  345. Pingback: chelovek soznaniye mozg

  346. Pingback: thefencefilm.co.ukcommunityprofilehswlux

  347. Pingback: bit.ly

  348. Pingback: cialis from canada

  349. Pingback: meritking

  350. Pingback: sandbox.autoatlantic.comcommunityprofilekawxvb

  351. Pingback: http://lwerfa.iwopop.com/

  352. Pingback: canadian pharmacy viagra

  353. Pingback: stromectol without doctor prescription

  354. Pingback: http://kawerf.iwopop.com/

  355. Pingback: cleantalkorg2.ru

  356. Pingback: bucha killings

Leave a Reply

Your email address will not be published.