Click to See Complete Forum and Search --> : shortcuts automatically created???


lnong
08-22-2003, 12:39 PM
I have a CGI script shown below that is suppose to read an Excel file and create an HTML table using the data. However, after it gets executed, two shortcuts are automatically created on my C:\ drive. There's a shortcut icon for "Questionaire.xls" and one for the folder "Questionaires". Im not sure what's creating these shortcuts but I dont want this to happen. How do I turn off this automated shortcut creation thing? By the way, if turn this code into a non-CGI script (by removing all CGI and HTML references) and run it from the command prompt, the shortcuts are not created. Anyone got any ideas?


#!/usr/bin/perl
use warnings;
use strict;
use CGI;
use Win32::OLE qw(in with);
use Win32::OLE::Const 'Microsoft Excel';
$Win32::OLE::Warn = 2;

my $excel = Win32::OLE->GetActiveObject('Excel.Application') || Win32::OLE->new('Excel.Application', 'Quit');
my $workbook = $excel->Workbooks->Open("c:\\Presales\\Questionaires\\Questionaire.xls");
my $worksheet = $workbook->Worksheets(1);

my $cgi = new CGI;
print
(
$cgi->header(),
$cgi->start_html(-title=>'Questionaire'),
"<table width='100%' align='center' border='1px' cellspacing='0px'>"
);

foreach my $row (1..5)
{
print
(
"<tr>".
"<td width='50%'>".$worksheet->Cells($row, 1)->{'Text'}."</td>".
"<td width='50%'>".$worksheet->Cells($row, 2)->{'Text'}."</td>".
"</tr>"
);
}

print
(
"</table>".
$cgi->end_html()
);

$workbook->Close;