Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default ComboBox.Value cannot be called in VBA?

Hi there,
I am using microsoft Excel 2003 Sp2. I have a problem after changing
Combobox list it remains there visible previous selected value even if it is
not actual anymore. It can be changed only by manually clicking and selecting
some new value. I found that there are 2 parameters in Combobox properties
(Text, Value) that changes this residual value, but when i am trying to
change it thru VB code (line is now commented) i get error 438 - object
doesn't support this method. So how can i change / delete the old value from
VB?

Thank you for help


private Sub UpdateInfo()

Set Data = Worksheets("Data")
Set Info = Worksheets("Info")
Dim cboTemp As OLEObject

Set cboTemp = Info.OLEObjects("SmlouvyC")
j = 0
With cboTemp
.Visible = True
.ListFillRange = ""
.LinkedCell = ""

.Visible = False
For i = 1 To 50

Data.Cells(j + 4, 1).Value = Data.Cells(KC, i + 7).Value
j = j + 1
If Data.Cells(KC, i + 7).Value = "" Then
GoTo LastRecord
End If
Next i
LastRecord:
.ListFillRange = "DATA!" + Range(Cells(4, 1), Cells(j + 2, 1)).Address
'.Value = ""
.Visible = True

End With


End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 58
Default ComboBox.Value cannot be called in VBA?

On Nov 4, 12:14 pm, Petr_R wrote:
Hi there,
I am using microsoft Excel 2003 Sp2. I have a problem after changing
Combobox list it remains there visible previous selected value even if it is
not actual anymore. It can be changed only by manually clicking and selecting
some new value. I found that there are 2 parameters in Combobox properties
(Text, Value) that changes this residual value, but when i am trying to
change it thru VB code (line is now commented) i get error 438 - object
doesn't support this method. So how can i change / delete the old value from
VB?

Thank you for help

private Sub UpdateInfo()

Set Data = Worksheets("Data")
Set Info = Worksheets("Info")
Dim cboTemp As OLEObject

Set cboTemp = Info.OLEObjects("SmlouvyC")
j = 0
With cboTemp
.Visible = True
.ListFillRange = ""
.LinkedCell = ""

.Visible = False
For i = 1 To 50

Data.Cells(j + 4, 1).Value = Data.Cells(KC, i + 7).Value
j = j + 1
If Data.Cells(KC, i + 7).Value = "" Then
GoTo LastRecord
End If
Next i
LastRecord:
.ListFillRange = "DATA!" + Range(Cells(4, 1), Cells(j + 2, 1)).Address
'.Value = ""
.Visible = True

End With

End Sub


Try:
Dim cboTemp As ComboBox
Set cboTemp = Info.OLEObjects("SmlouvyC").Object
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
fill combobox depending on selection from another combobox Adam Francis Excel Discussion (Misc queries) 2 July 24th 08 07:39 PM
Combobox items determined by the selection in another combobox Alerion Excel Programming 2 September 13th 06 01:07 PM
Combobox options based on the input of another combobox afmullane[_5_] Excel Programming 1 May 3rd 06 01:44 PM
ComboBox list reliant on the entry from a different ComboBox ndm berry[_2_] Excel Programming 4 October 4th 05 04:40 PM
How Do I Load A ComboBox RowSource From The Results Of Another ComboBox Minitman[_4_] Excel Programming 3 October 26th 04 07:58 PM


All times are GMT +1. The time now is 01:57 AM.

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

About Us

"It's about Microsoft Excel"