DateSerial is not an OLE function (there is not such thing as an OLE function anyways, they are all methods on an object), it is a builtin VBScript function. You cannot access it from Perl as far as I know. However, you can emulate the function using Win32::OLE like this:
use Win32::OLE::Variant;
sub DateSerial {
my($year,$month,$day) = @_;
return Variant(VT_BSTR, "$month/$day/$year")->As(VT_DATE);
}
This will only work if you are using the English locale settings; otherwise the string format of the date may be different. You can force the locale used by Win32::OLE to English like this:
use Win32::OLE::NLS qw(:DEFAULT :LANG :SUBLANG);
my $english = MAKELCID( MAKELANGID(LANG_ENGLISH, SUBLANG_NEUTRAL) );
Win32::OLE->Option(LCID => $english);
|