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

Hi.
I have a function which makes OLE comboboxes:

Sub newCombo(intRowIndex As Integer, intColumnIndex As Integer, strSignal As
String)

Then I have a select case selection which makes an array with items for the
combobox:
Select Case intRowIndex
Case 18 + 3
varDiff = Array("Sea Water Pressure", "CC_SetPlus")
intDiffLength = 1
.....

Creation of the combobox
With Cells(intRowIndex, intColumnIndex)
'Create a OLE oject and set size and add it to the active sheet
Set oOLE = ActiveSheet.OLEObjects.Add(ClassType:="Forms.combo box.1", _
Left:=.Left, Top:=.Top, Width:=.Width,
Height:=.Height)


combo.AddItem (strSignal)

'Add the other choices to the combobox
For j = 0 To intDiffLength
combo.AddItem (varDiff(j))
Next j
'Set the standard choice to be chosen
combo.ListIndex = 0

Thats the macro which makes the comboboxes and sets the items and the
standard choice.

Then I have another macro which will look in the excel sheet and take the
value of the cell and put in a variable. Then I create a visio document and a
shape and I want to assign the text from the excel sheet to the shape. It
works great for an usuall cell, but it doesn't work for the comboboxes. I
dont know how to take the value from an OLE combobox.

this is what i do to take the value of the excel cell.
shpObjComp.Text = Cells(varPinNrA(i) + 2, intColumn + 1)

Perhaps it would work if the cell which the combobox lies in knows what the
combobox is showing, but i don't know how to do that!
HELP please!

/Mikkan

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 230
Default OLE comboboxes

Doesn't the combo box have a linked cell property, and cannot you take the
value from that cell and not the combo?
"Mikkan" wrote in message
...
Hi.
I have a function which makes OLE comboboxes:

Sub newCombo(intRowIndex As Integer, intColumnIndex As Integer, strSignal
As
String)

Then I have a select case selection which makes an array with items for
the
combobox:
Select Case intRowIndex
Case 18 + 3
varDiff = Array("Sea Water Pressure", "CC_SetPlus")
intDiffLength = 1
....

Creation of the combobox
With Cells(intRowIndex, intColumnIndex)
'Create a OLE oject and set size and add it to the active sheet
Set oOLE =
ActiveSheet.OLEObjects.Add(ClassType:="Forms.combo box.1", _
Left:=.Left, Top:=.Top, Width:=.Width,
Height:=.Height)


combo.AddItem (strSignal)

'Add the other choices to the combobox
For j = 0 To intDiffLength
combo.AddItem (varDiff(j))
Next j
'Set the standard choice to be chosen
combo.ListIndex = 0

Thats the macro which makes the comboboxes and sets the items and the
standard choice.

Then I have another macro which will look in the excel sheet and take the
value of the cell and put in a variable. Then I create a visio document
and a
shape and I want to assign the text from the excel sheet to the shape. It
works great for an usuall cell, but it doesn't work for the comboboxes. I
dont know how to take the value from an OLE combobox.

this is what i do to take the value of the excel cell.
shpObjComp.Text = Cells(varPinNrA(i) + 2, intColumn + 1)

Perhaps it would work if the cell which the combobox lies in knows what
the
combobox is showing, but i don't know how to do that!
HELP please!

/Mikkan



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
Comboboxes mr-bear New Users to Excel 1 November 21st 06 10:05 AM
Comboboxes Darren Excel Programming 1 January 23rd 05 05:35 PM
ComboBoxes Ryan Excel Programming 0 April 14th 04 10:56 PM
Comboboxes Angeliki Excel Programming 1 March 3rd 04 12:00 PM
Comboboxes David W[_3_] Excel Programming 1 August 29th 03 11:13 PM


All times are GMT +1. The time now is 05:40 PM.

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"