ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   calling calendar, get Automation Error (https://www.excelbanter.com/excel-programming/377869-calling-calendar-get-automation-error.html)

Arnold Klapheck

calling calendar, get Automation Error
 
I have a form that calls on the calendar control but I get this error.
Automation Error -2147417848 The object invoked has disconnected from its
clients

below is the code:

Private Sub cboDateReq_MouseDown(ByVal Button As Integer, ByVal Shift As
Integer, ByVal X As Single, ByVal Y As Single)

CalendarReq.Visible = True
CalendarReq.SetFocus

If Not IsNull(cboDateReq) Then
CalendarReq.Value = cboDateReq.Value
Else
CalendarReq.Value = Date
End If

End Sub

I get the error message in the above code


NickHK

calling calendar, get Automation Error
 
Arnold,
What do you expect from this line ?
If Not IsNull(cboDateReq) Then

Do you mean
If cboDateReq.ListIndex=-1 Then
'No selection made

Also, do you need the :
CalendarReq.SetFocus

NickHK

"Arnold Klapheck" wrote in
message ...
I have a form that calls on the calendar control but I get this error.
Automation Error -2147417848 The object invoked has disconnected from its
clients

below is the code:

Private Sub cboDateReq_MouseDown(ByVal Button As Integer, ByVal Shift As
Integer, ByVal X As Single, ByVal Y As Single)

CalendarReq.Visible = True
CalendarReq.SetFocus

If Not IsNull(cboDateReq) Then
CalendarReq.Value = cboDateReq.Value
Else
CalendarReq.Value = Date
End If

End Sub

I get the error message in the above code





All times are GMT +1. The time now is 08:36 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com