Minggu, 30 Juni 2013

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

 


OOPS! Excel 2007. I try to remember to include that...
Steve

--- Tim Lewis wrote:
>
> Which version of Excel are you using?
>
> From: noskosteve
> Sent: Saturday, June 29, 2013 12:46 AM
>
> More interesting schitck...and solution, sort of...
>
> I noticed that the crosshatching was slightly different via CommandButton Object>Edit.
>
> I moved the CommandButton down to get a better look at the difference and realized that I had frozen the pane with just the top row frozen at the top and this CommandButton was in the frozen top row. The visible difference was aparently due to the button size/border interferring a bit with the frozen pane divider line.
>
> When, in Design Mode, I moved the button out of the frozen row and did the RightClick>CommandButton Object>Edit, it now shows as being selected (faint dotted line inside it and black, square, size-handles around the perimiter) and the cursor is at the beginning of the Caption allowing editing the Caption (obviously now in an edit mode).
> The conclusion, at least for this, being that Editing is disabled when the CommandButton is in the frozen row.
>
> Then...
> With the CommandButton out of the frozen row and trying normal operation (OUT of Design Mode), it now will function repeatedly (out of coma), when re-selecting the Sheet. It has the faint dotted box inside it indicating, I believe, that it has the Focus upon re-selecting the sheet.
>
> So ... this crosshatching (during my 'normal operation') is some sort of a symptom of being in a frozen top row...?
>
> Try 'freezing' your button... (no double meaning intended (;-0)
>
> Sheesh, Steve
>
> At least his keeps me off the streets at night, though this was pushing me in that direction. (;-D)
>
> --- "noskosteve" wrote:
> >
> > Tim,
> >
> > In its preference box it is called CommandButton. Adding annother button by: Developer>Controlls>ToolBox/Insert>ActiveX Controlls (that I must have used to place it originally) it appears to be an ActiveX CommandButton . It is the first choice in teh ActiveX section. There is just a button to click, no spin arrows.
> > (FWIW I never did understand the significance of ActiveX controls. I just try things and figure out how to use them...)
> >
> >
> > Here's an interesting turn of events that may give hints. As I looked around for more information on the CommandButton, I went into Design mode and right clicked the button. The resulting popup menu, among other things, had "CommandButton Object >". Selecting this showed "Edit". Selecting "Edit" then dismissed the popup and caused the SAME crosshatching! Try that...
> >
> > Then, left clicking on the button removed the crosshatching.
> > Right clicking also removed the crosshatching and brought up the ppropriate popup menu.
> >
> > Anything?...
> >
> > Regards, Steve
> >
> > --- Tim Lewis wrote:
> > >
> > > Steve, trying to get the same result, but I am not getting the same thing that you are seeing. The UserForm1.Sb... - are those spin buttons?
> > >
> > >
> > >
> > > From: noskosteve
> > > Sent: Friday, June 28, 2013 12:57 AM
> > >
> > >
> > > 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
> > >
> > >
> > >
> > > [Non-text portions of this message have been removed]
> > >
> >
>
>
>
> [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 (8)
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