I know Perl and I’ve worked some with VBA, so I can give this a shot — but I haven’t used Win32::OLE, so you may have to experiment with this a bit.
Question 1: How to open in read-only mode
The prototype for Workbooks.Open, from Microsoft’s VBA reference is:
expression.Open(FileName, UpdateLinks, ReadOnly, Format, Password, WriteResPassword, IgnoreReadOnlyRecommended, Origin, Delimiter, Editable, Notify, Converter, AddToMru, Local, CorruptLoad)
In VBA, you’d be able to do:
In Perl, you can either pass undef for UpdateLinks to pass it, or use a named parameter in a hash. So I’m guessing it would be something like:
my $Book = $Excel->Workbooks->Open(FileName => $file, ReadOnly=>1); #maybe?
So basically, if you set ReadOnly to true, I’m guessing it won’t pop up an alert to open in read-only mode.
Question 2: Reading the date
In VBA, the string representation of a date cell always seems to be of mm/dd/yyyy format, regardless of how the cell’s formatting is set. If this is the case, you can use a simple regex to convert that into a Perl-style date:
# assume $dateStr has the date in string format, from OLE
$dateStr =~ /(\d+)\/(\d+)\/(\d+)/; # matches d+/d+/d+
$dateMonths = $1;
$dateDays = $2;
$dateYears = $3;
$date = timelocal(0, 0, 0, $dateDays, $dateMonths , $dateYears );