Hi,
as i had some problems exporting a date to excel, i tried to find a workarround.
The problem:
writing a date via ole and lotus script into an excel sheet, resulted in a text and not in a date. This can not be sorted.
So i tried to calculate the difference in days based on 01.01.1900. As “normal” timedifference could not handle such a long time period i used timedifferencedouble.
The result divided by (606024) looked fine.
Putting a date format over this and fine.
No, not really. To make sure i did not make a misstake i wrote out the date as text also.
What a surprise, the calculated day was to days before the “text-Date”.
Well, i could solve this by adding 2 days but i guess this is looking like a bug.
here’s my (not optimized) code:
Dim Temp1 As NotesDateTime
Dim Temp2 As NotesDateTime
Dim Temp3 As Double
Set temp1 = New NotesDateTime(Cdat("01.01.1900"))
Set temp2 = New NotesDateTime(Cdat(Text))
temp3 = Temp2.TimeDifferenceDouble(Temp1)
oexcel.cells(row,col).NumberFormat = "TT.MM.JJJJ"
oexcel.cells(row,col).value = (temp3 / 86400.0) + 2.0
So ist there an error in the code or is ther a bug in the notesfunction ???
G.