DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

convert long to date in VBScript

Hello,

I want to get the coordinates of the cursor in via Cursor.X1 in the VIEW module. because I need a date/time variant I would like how to convert the long value I get from the method to a Date/Time variant. In the coordinate window the display is in datetime, too, when the axis is a type of time-axis.
If I get a string representation of the long value then it would be possible to convert via CDate, but I don't even get a string. How can I do that?

Thanks,
Alexander Maier
0 Kudos
Message 1 of 2
(4,601 Views)
Hello!
 
You can convert the Cursor position to a String and then to Date Variant:
 
MyTime = CDate(Str(View.ActiveSheet.Cursor.X1,"#hh.nn.ss"))
Best regards
 
Ken
0 Kudos
Message 2 of 2
(4,589 Views)