Jumat, 28 Juni 2013

RE: [ExcelVBA] Sheet CommandButton becomes "crosshatched" and comatose.

 

What happens if you put in exit sub after activate sheet 3

Regards, Ralph

noskosteve <noskosteve@yahoo.com> wrote:


>
>
>Maybe I should just take up knitting.
>
>Famous last words: Everything worked fine until...
>
>I have a Sheet1.CommandButton that normally brings up a UserForm for some preferences to be entered/changed by the user and works fine.
>
>I added a function which does not need these prefs. It's just a checkBox on Sheet3. When that function is activated, I bring up a message box indicating that the function must be disabled (unchecked) to see the Prefs' UserForm. Then, I exit the CommandButton_Click Sub without Showing the UserForm. Life is still good.
>
>Being the nice guy that I am, I figured it would be helpful to also automaticlly activate sheet3 which has the checkBox, so the user can easily un-check it and go back and see the UserForm to enter these prefs.
>
>Simply adding the Sheet3.Activate, causes the Sheet1.CommandButton to become crosshatched (when I reselect sheet1) in otder to to click it and enter the prefs.
>It is full of diagonal lines and unresponsive.
>
>When clicking the 'crossed-out' CommandButton, the crosshatch goes away, but it is now non-responsive. The Click Event does not fire the Click Sub.
>VBA doesn't appear to be paused or haulted in any way - other things work normally.
>
>Doing just about anything else that causes some other VBA code to execute then re-activates this catatonic CommandButton.
>
>Clicking the Reset button in the VBA window does not awaken the comatose CommandButton, nor change the title bar indicating VBA has changed modes (like going out of debug mode)
>
>FWIW here's the Click sub with the problem (near the end):
>----------------------------------------------
>Private Sub PrefsButton_Click() ' Put filter prefs into Form
>Debug.Print "S_1 2 Filter Prefs Button Clicked. ";
>
>' This sub is in Sheet1.
>
>' Look at the ELSE for where the 'crosshatch' problem occurs...
>
>If Sheet3.Select_2000 Then ' The new function's CheckBox.
>
>' All the stuff from here to the Else workes fine:
>' Get Pref values into the UserForm
>' SSB
>userform1.SB_Upper_Narrow = sheet1.Range("SSB_Narrow_Upper_Pref").Value
>userform1.SB_Upper_Mid = sheet1.Range("SSB_Mid_Upper_Pref").Value
>userform1.SB_Upper_Wide = sheet1.Range("SSB_Wide_Upper_Pref").Value
>' ...
>' There is more of the same kind of setting here, not shown.
>' ...
>
>userform1.Show ' When execution get here, this works.
>
>Else ' Abort the filter settings form
>
>MsgBox "Filter settings from this sheet are only for the TS-2000. To change them, change the radio type to TS-2000 on the Memories sheet.", vbExclamation, " CAUTION CAUTION CAUTION"
>
>' Now, Trouble. Activate the Memories sheet for the user to more easily make the change.
>
>Sheet3.Activate ' Adding this ONE line causes this CommandButton to become "crosshatched" when re-selecting Sheet1 !
>
>' I've tried other things here like:
>' End, or
>' Reset, or
>' PrefsButton.Activate to no avail.
>
>Exit Sub
>End If
>
>End Sub
>-------------------------------------------------
>
>Sigh, Steve
>
>
>
><!-- #ygrp-mkp { border: 1px solid #d8d8d8; font-family: Arial; margin: 10px 0; padding: 0 10px; } #ygrp-mkp hr { border: 1px solid #d8d8d8; } #ygrp-mkp #hd { color: #628c2a; font-size: 85%; font-weight: 700; line-height: 122%; margin: 10px 0; } #ygrp-mkp #ads { margin-bottom: 10px; } #ygrp-mkp .ad { padding: 0 0; } #ygrp-mkp .ad p { margin: 0; } #ygrp-mkp .ad a { color: #0000ff; text-decoration: none; } #ygrp-sponsor #ygrp-lc { font-family: Arial; } #ygrp-sponsor #ygrp-lc #hd { margin: 10px 0px; font-weight: 700; font-size: 78%; line-height: 122%; } #ygrp-sponsor #ygrp-lc .ad { margin-bottom: 10px; padding: 0 0; } #actions { font-family: Verdana; font-size: 11px; padding: 10px 0; } #activity { background-color: #e0ecee; float: left; font-family: Verdana; font-size: 10px; padding: 10px; } #activity span { font-weight: 700; } #activity span:first-child { text-transform: uppercase; } #activity span a { color: #5085b6; text-decoration: none; } #activity span span { color: #ff7900; } #activity span .underline { text-decoration: underline; } .attach { clear: both; display: table; font-family: Arial; font-size: 12px; padding: 10px 0; width: 400px; } .attach div a { text-decoration: none; } .attach img { border: none; padding-right: 5px; } .attach label { display: block; margin-bottom: 5px; } .attach label a { text-decoration: none; } blockquote { margin: 0 0 0 4px; } .bold { font-family: Arial; font-size: 13px; font-weight: 700; } .bold a { text-decoration: none; } dd.last p a { font-family: Verdana; font-weight: 700; } dd.last p span { margin-right: 10px; font-family: Verdana; font-weight: 700; } dd.last p span.yshortcuts { margin-right: 0; } div.attach-table div div a { text-decoration: none; } div.attach-table { width: 400px; } div.file-title a, div.file-title a:active, div.file-title a:hover, div.file-title a:visited { text-decoration: none; } div.photo-title a, div.photo-title a:active, div.photo-title a:hover, div.photo-title a:visited { text-decoration: none; } div#ygrp-mlmsg #ygrp-msg p a span.yshortcuts { font-family: Verdana; font-size: 10px; font-weight: normal; } .green { color: #628c2a; } .MsoNormal { margin: 0 0 0 0; } o { font-size: 0; } #photos div { float: left; width: 72px; } #photos div div { border: 1px solid #666666; height: 62px; overflow: hidden; width: 62px; } #photos div label { color: #666666; font-size: 10px; overflow: hidden; text-align: center; white-space: nowrap; width: 64px; } #reco-category { font-size: 77%; } #reco-desc { font-size: 77%; } .replbq { margin: 4px; } #ygrp-actbar div a:first-child { /* border-right: 0px solid #000;*/ margin-right: 2px; padding-right: 5px; } #ygrp-mlmsg { font-size: 13px; font-family: Arial, helvetica,clean, sans-serif; *font-size: small; *font: x-small; } #ygrp-mlmsg table { font-size: inherit; font: 100%; } #ygrp-mlmsg select, input, textarea { font: 99% Arial, Helvetica, clean, sans-serif; } #ygrp-mlmsg pre, code { font:115% monospace; *font-size:100%; } #ygrp-mlmsg * { line-height: 1.22em; } #ygrp-mlmsg #logo { padding-bottom: 10px; } #ygrp-msg p a { font-family: Verdana; } #ygrp-msg p#attach-count span { color: #1E66AE; font-weight: 700; } #ygrp-reco #reco-head { color: #ff7900; font-weight: 700; } #ygrp-reco { margin-bottom: 20px; padding: 0px; } #ygrp-sponsor #ov li a { font-size: 130%; text-decoration: none; } #ygrp-sponsor #ov li { font-size: 77%; list-style-type: square; padding: 6px 0; } #ygrp-sponsor #ov ul { margin: 0; padding: 0 0 0 8px; } #ygrp-text { font-family: Georgia; } #ygrp-text p { margin: 0 0 1em 0; } #ygrp-text tt { font-size: 120%; } #ygrp-vital ul li:last-child { border-right: none !important; } -->

[Non-text portions of this message have been removed]

__._,_.___
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (2)
Recent Activity:
----------------------------------
Be sure to check out TechTrax Ezine for many, free Excel VBA articles! Go here: http://www.mousetrax.com/techtrax to enter the ezine, then search the ARCHIVES for EXCEL VBA.

----------------------------------
Visit our ExcelVBA group home page for more info and support files:
http://groups.yahoo.com/group/ExcelVBA

----------------------------------
More free tutorials and resources available at:
http://www.mousetrax.com

----------------------------------
.

__,_._,___

Tidak ada komentar:

Posting Komentar