|
-
Feb 15th, 2006, 11:51 PM
#1
Thread Starter
Fanatic Member
Floating Userform on Excel Spreadsheet
Hi All,
Forgive me if I don't always use the correct terminology. I have what I call a 'floating' Userform (I think the term is modeless) on an Excel Spreadsheet with option buttons whose values change depending on the location and contents of cells that are clicked. The form is continuously visible as different cells are clicked and is normally de-highlighted until you actually click on the form. I use the Worksheet_SelectionChange event to trigger loading the values of the option buttons. Thus, as various cells are clicked, either with the cursor, or Enter key, or arrow keys, the option button values continuously change as the cells are traversed. This is as designed.
Here's the problem. Apparently at random, when a cell is clicked, the form suddenly becomes highlighted, preventing further traversing of cells unless the cursor is used to click a cell (thus de-highlighting the form). The odd thing is that this strange behavior of the form suddenly becoming highlighted occurs at random. I've found a workaround by by setting the form Enable property to False, load the form values, then set the Enable property to True. But, I can't figure out why this is necessary.
Any idea why the form suddenly becomes highlighted as I move among the worksheet cells w/ Enter or arrow keys?
-
Feb 16th, 2006, 07:21 AM
#2
Re: Floating Userform on Excel Spreadsheet
Do you use the setfocus in your code on the event on cells?
Perhaps one is firing when it shouldn't?
Feeling like a fly on the inside of a closed window (Thunk!)
If I post a lot, it is because I am bored at work! ;D Or stuck...
* Anything I post can be only my opinion. Advice etc is up to you to persue...
-
Feb 16th, 2006, 12:56 PM
#3
Thread Starter
Fanatic Member
Re: Floating Userform on Excel Spreadsheet
 Originally Posted by Ecniv
Do you use the setfocus in your code on the event on cells?
Perhaps one is firing when it shouldn't?
I'm not using setfocus. Should I be? I understand .visible and believe I understand .enabled, but I don't know how setfocus comes into play.
-
Feb 28th, 2006, 07:34 AM
#4
Re: Floating Userform on Excel Spreadsheet
Uhh not sure it actually applies to Excel (sorry!).
On Access forms, .SetFocus pulls the focus to the form/control. Thought there may be one in Excel.
Can you re-call the .Show method? Would that refloat it back up?
EDIT:
A thought on the original post - how do you fill the values?
Maybe the code is setting the focus/highlighting the field thus making the form active?
Feeling like a fly on the inside of a closed window (Thunk!)
If I post a lot, it is because I am bored at work! ;D Or stuck...
* Anything I post can be only my opinion. Advice etc is up to you to persue...
-
Feb 28th, 2006, 10:12 AM
#5
Re: Floating Userform on Excel Spreadsheet
What version of Excel are you running?
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Feb 28th, 2006, 11:54 PM
#6
Thread Starter
Fanatic Member
Re: Floating Userform on Excel Spreadsheet
 Originally Posted by RobDog888
What version of Excel are you running?
I'm using Excel 2002. The workaround seems to work, so I'm happy. However, I'm still curious as to the strange behavior.
On another topic, thanks again for your help with the API - it works great.
-
Feb 28th, 2006, 11:57 PM
#7
Re: Floating Userform on Excel Spreadsheet
Glad to have helped and now I remember and see how this thread ties into your other thread.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|