Hello people!
His Calendar by Bluecactus not working never.
(If who have a Calendar by Bluecatus working, please me a copy in the forum topic. Thanks)
when I launch the Form, the VBA crashes, “Error 13”, “Incompatible types” (Portuguese Language traduction)
The editor VBE goes to tihis line: Call DatePick.FillVars (....)
(If who have a Calendar by Bluecatus working, please me a copy in the forum topic. Thanks)
(Im using Excel 2013 32bit Windows version.)
below are part of the the functions in crash:
error line is Blue.
‘----------------------------------------------------------------------
Function getUserDate(Optional defaultDate As Date = Empty, Optional dpMode As Integer = 0, _
Optional displayComments As Boolean = False, Optional eL As Variant = "") As Variant
' This code does the actual call to the calendar form.
Dim i As Integer, addText As String, dateResults As Variant, eventList As Variant
' customUserDate() not called - set some defaults
If Not useCustomExtras Then
baseYear = DatePart("yyyy", Date) - 10
endYear = DatePart("yyyy", Date) + 10
optionFindToday = False
widthDay = 30
heightDay = 20
forceCancel = False
bkColor = vbWindowBackground
selColor = vbHighlight
highColor = 255
End If
If IsArray(eL) Then eventList = eL
Load DatePick
' Custom form position specified
If useCustomExtras And formX <> -1 And formY <> -1 Then
DatePick.startupposition = 3
DatePick.Left = formX
DatePick.Top = formY
End If
useCustomExtras = False
‘ERROR-HERE IS THE PROBLEM: ‘Call DatePick.FillVars(…)
Call DatePick.FillVars(defaultDate, dpMode, forceCancel, displayComments, eventList, optionFindToday, widthDay, heightDay, baseYear, endYear, bkColor, selColor, highColor)
DatePick.Show
' Events returned to this function - repackage them.
If IsArray(eventCodes) Then
ReDim dateResults(0 To UBound(eventCodes))
dateResults(0) = displayDate
For i = 1 To UBound(eventCodes)
dateResults(i) = eventCodes(i)
Next i
Else
If displayDate = Empty Then
dateResults = ""
Else
dateResults = displayDate
End If
End If
getUserDate = dateResults
End Function
Sub FillVars(Optional sD As Date = Empty, Optional dpM As Integer = 0, Optional fC As Boolean = True, _
Optional dC As Boolean = False, Optional eL As Variant = "", Optional oFT As Boolean = False, _
Optional widthDay As Double = 30, Optional heightDay As Double = 20, Optional bY As Integer = 0, _
Optional endYear As Integer = 0, Optional bC As Long = vbWindowBackground, Optional sC As Long = vbHighlight, _
Optional hC As Long = 255)
' This sub takes the place of Userform_Initialize and is used to fetch parameters from the calling code.
' You may wish to change some of the defaults above.
'continues....