Hi,
I have imported huge log file (35 MB size) into a worksheet. One of its column contain some data.
There is a Main Sheet which contains "ComboBoxStartT ime" ActiveX Combo control.
I am populating data from a range into this combobox. The number of rows containing data are huge because of size of file (let say: 506390 or more) However i am getting an error:
Run-time error '-2147467259 (80004005)
The code for populating combobox is:
Error is coming at line:
Any help would be highly appreciated
Thanks
Prashant Dixit
I have imported huge log file (35 MB size) into a worksheet. One of its column contain some data.
There is a Main Sheet which contains "ComboBoxStartT ime" ActiveX Combo control.
I am populating data from a range into this combobox. The number of rows containing data are huge because of size of file (let say: 506390 or more) However i am getting an error:
Run-time error '-2147467259 (80004005)
The code for populating combobox is:
Code:
Public Sub FillStartTimeComboBox(Datasheet As Worksheet, ByVal FirstDataRow As Long) Application.ScreenUpdating = False Dim myRange As Range Dim r As Range Dim LastDataRow As Long Dim LValue As String 'Sheet1.ComboBoxStartTime.Clear Datasheet.Activate LastDataRow = Cells(1000000, 1).End(xlUp).row 'Set the range of cells, whose values will be put into the combobox Set myRange = Range(Cells(FirstDataRow, 1), Cells(LastDataRow, 1)) 'work through each cell in the range and put the value in the Spectrum combobox. Cells(FirstDataRow, 1).Select For Each r In myRange 'add cell value to combobox list if it is not a blank cell. If r.Value <> "" Then LValue = Format(r, "dd/mm/yyyy hh:mm:ss") Sheet1.ComboBoxStartTime.AddItem LValue End If Next r Application.ScreenUpdating = True End Sub
Error is coming at line:
Code:
Sheet1.ComboBoxStartTime.AddItem LValue
Thanks
Prashant Dixit
Comment