I have a sub in VBA that calls another sub to perform some analysis on data if the user pastes it in. The code below errors as:
Run-time error'-2147467259 (80004005)': Method 'List' of object'_CommandBarComboBox' failed
Private Sub Worksheet_Change(ByVal Target As Range)
Dim UndoList As String
UndoList = Application.CommandBars("Standard").Controls("&Undo").List(1) 'Errors Here!
If Left(UndoList, 5) = "Paste" Then
Dim Annotations() As String
FindAnnots
End If
End Sub
Any idea as to why the object's list doesn't exist?