Combobox is not appearing on top of other control
Hi ALL,
I am creating a UI using VBA form where I am using OWC11 spreadsheet control and using Office 2003. What I want is that--- when user will select the perticular cell(say, D4) in the OWC spreadsheet, a combo box should appear in place of the cell and from the drop-down list box user will select the correct option and that will be the value of that cell (i.e. D4).
Now I've written the code like following:--
Code//
Private Sub Spreadpfd_SelectionChanging(ByVal Range As OWC11.Range)
Dim ctop As Double
Dim cleft As Double
Dim cheight As Double
Dim cwidth As Double
curr_cadd = Range.Address
curr_cadd = Mid(curr_cadd, 2, 1)
If curr_cadd = "D" Then
ctop = fPFD.Spreadpfd.ActiveCell.Top
cleft = fPFD.Spreadpfd.ActiveCell.Left
cheight = fPFD.Spreadpfd.ActiveCell.Height
cwidth = fPFD.Spreadpfd.ActiveCell.Width
fPFD.Combooptype.Top = fPFD.Spreadpfd.Top + ctop
fPFD.Combooptype.Left = fPFD.Spreadpfd.Left + cleft + 19.75
fPFD.Combooptype.Height = cheight
fPFD.Combooptype.Width = cwidth
fPFD.Spreadpfd.ZOrder (fmBottom)
fPFD.Combooptype.ZOrder (fmTop)
fPFD.Combooptype.Visible = True
fPFD.Combooptype.SetFocus
Else
fPFD.Combooptype.Visible = False
End If
End Sub
Code//
The Issue is that , the combobox is not getting visible on top of that cell(i.e. D4). --- Can anyone help.....Any help will be greatly appreaciated.....
Thanks & Regards,
Subhrajit
|