Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default MSForms 2.0 Combobox problem

I'm working on a project that runs inside Excel. When a user clicks on an
excel Cell, an MSForms 2.0 Combobox is created through code in c++, and
placed over that cell. The dropdown portion is populated with a list of
possible choices, all of which happen to be other cells on the same sheet,
but the user is free to type their own string into the combobox, too. The
combobox is linked to the excel cell through _OleObject-put_LinkedCell, to
keep the value of the cell and the combobox synchronized at all times. When
the user leaves the cell, the combobox is hidden, leaving the cell displayed
with the value from the combobox.

The problem is that when I click on a cell with an existing string, and I
edit it such that the string now matches one of the choices in the dropdown
list, then when I leave that cell, the new value typed is never sent to the
cell. If I edit the string such that a string that is NOT in the dropdown
list is created and then leave the cell, the new string appears in the cell
once the combobox is hidden.

Illustrated example (working case):
-combobox contains "Entry1, Entry2, .... Entry15."
-User clicks on a cell that says "Entry1" and the combobox is made visible.
The combobox text says "Entry1".
-User types a "6" at the end, to make the string "Entry16."
-User leaves cell, and the combobox is hidden, leaving the cell displayed
with the value "Entry16"

(bad case)
-combobox contains "Entry1, Entry2, .... Entry15."
-User clicks on a cell that says "Entry1" and the combobox is made visible.
The combobox text says "Entry1".
-User types a "5" at the end, to make the string "Entry15."
-User leaves cell, and the combobox is hidden, leaving the cell displayed
with the value "Entry1"

Any suggestions would be greatly appreciated.

thanks!
-M
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default MSForms 2.0 Combobox problem

I should add, too, that if I turn off the combobox's Autocomplete
functionality, this problem goes away. Unfortunately, autocomplete was a big
reason the comboboxes were used in the first place, and turning it off is not
an option.

"MTC75" wrote:

I'm working on a project that runs inside Excel. When a user clicks on an
excel Cell, an MSForms 2.0 Combobox is created through code in c++, and
placed over that cell. The dropdown portion is populated with a list of
possible choices, all of which happen to be other cells on the same sheet,
but the user is free to type their own string into the combobox, too. The
combobox is linked to the excel cell through _OleObject-put_LinkedCell, to
keep the value of the cell and the combobox synchronized at all times. When
the user leaves the cell, the combobox is hidden, leaving the cell displayed
with the value from the combobox.

The problem is that when I click on a cell with an existing string, and I
edit it such that the string now matches one of the choices in the dropdown
list, then when I leave that cell, the new value typed is never sent to the
cell. If I edit the string such that a string that is NOT in the dropdown
list is created and then leave the cell, the new string appears in the cell
once the combobox is hidden.

Illustrated example (working case):
-combobox contains "Entry1, Entry2, .... Entry15."
-User clicks on a cell that says "Entry1" and the combobox is made visible.
The combobox text says "Entry1".
-User types a "6" at the end, to make the string "Entry16."
-User leaves cell, and the combobox is hidden, leaving the cell displayed
with the value "Entry16"

(bad case)
-combobox contains "Entry1, Entry2, .... Entry15."
-User clicks on a cell that says "Entry1" and the combobox is made visible.
The combobox text says "Entry1".
-User types a "5" at the end, to make the string "Entry15."
-User leaves cell, and the combobox is hidden, leaving the cell displayed
with the value "Entry1"

Any suggestions would be greatly appreciated.

thanks!
-M

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Dim CTL as MSForms.Control always sets as Control/Combobox Post Tenebras Lux Excel Programming 2 August 11th 06 06:51 AM
MSForms.ReturnInteger assignment Tim[_44_] Excel Programming 0 January 11th 06 09:50 PM
How to populate an MSForms.ReturnInteger value Tim[_44_] Excel Programming 0 January 10th 06 07:36 PM
Qualifying OptionButton with ro without MSForms augustus Excel Programming 2 January 31st 05 04:37 PM
MSForms cancel Tritan Excel Programming 1 July 17th 03 08:50 PM


All times are GMT +1. The time now is 12:32 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"