Hi All,
Last year we developed a simple excel based application having a combo box and button.
On opening the excel sheet, we were filling the combo box with project name from database, and on selection, we were giving end user to view selected project's other details from the database.
Now from last month, on opening the this tool, we get the below exception.
The code snippet for filling the combobox is
---------------------------
Public Sub FillComboBox()
Dim sStr As String
Dim rs As New ADODB.Recordset
sSQL = "Select Project .......From Project table."
closeRS
OpenDB
rs.Open sSQL, sConnect, adOpenKeyset, adLockOptimistic
With ActiveSheet.ComboBox1 <---Gets exception here
.Clear
Do
.AddItem rs![Project]
rs.MoveNext
Loop Until rs.EOF
End With
Set rs = Nothing
End Sub
Please me help me to resolve this issue.
Sonu88