C
cosmoKen
Hi,
In a Excel VBA macro, I have a Date Time Picker from which I want to
read and write dates.
Properties of my DTPicker control :
..customformat = "dd/MM/yyyy"
..checkbox = true
Sub save_detail()
Dim MyDate As Date
[...]
If IsDate(MainForm.txtMepDate.value) Then
MyDate = CDate(MainForm.txtMepDate.value)
Worksheets("donnees").Cells(flux_line, 50).value = MyDate
Else
Worksheets("donnees").Cells(flux_line, 50).value = ""
End If
[...]
End Sub
Sub init_detail(selected_flux As String)
Dim MyDate As Date
[...]
If IsDate(Worksheets("donnees").Cells(flux_line, 50).value)
Then
MyDate = CDate(Worksheets("donnees").Cells(flux_line,
50).value)
MainForm.txtMepDate.value = MyDate
Else
MainForm.txtMepDate.value = Null
End If
[...]
End Sub
The part "save_detail" works good : I find in my workbook cell a valid
date "dd/MM/yyyy hh:mm:ss"
But for the init_detail, it works good until I close the workbook and
reopen it.
Values saved before I close the workbook cannot be set with
init_detail, I have the error :
Error n°35788 : "An error occured in a call to the Windows Date and
Time Picker control"
I have tried many things I have read (window visible, change custom
format, etc.) but no solution.
Thanks for help
In a Excel VBA macro, I have a Date Time Picker from which I want to
read and write dates.
Properties of my DTPicker control :
..customformat = "dd/MM/yyyy"
..checkbox = true
Sub save_detail()
Dim MyDate As Date
[...]
If IsDate(MainForm.txtMepDate.value) Then
MyDate = CDate(MainForm.txtMepDate.value)
Worksheets("donnees").Cells(flux_line, 50).value = MyDate
Else
Worksheets("donnees").Cells(flux_line, 50).value = ""
End If
[...]
End Sub
Sub init_detail(selected_flux As String)
Dim MyDate As Date
[...]
If IsDate(Worksheets("donnees").Cells(flux_line, 50).value)
Then
MyDate = CDate(Worksheets("donnees").Cells(flux_line,
50).value)
MainForm.txtMepDate.value = MyDate
Else
MainForm.txtMepDate.value = Null
End If
[...]
End Sub
The part "save_detail" works good : I find in my workbook cell a valid
date "dd/MM/yyyy hh:mm:ss"
But for the init_detail, it works good until I close the workbook and
reopen it.
Values saved before I close the workbook cannot be set with
init_detail, I have the error :
Error n°35788 : "An error occured in a call to the Windows Date and
Time Picker control"
I have tried many things I have read (window visible, change custom
format, etc.) but no solution.
Thanks for help