#! c:/perl/bin/perl.exe # require 5.008; use strict; use warnings 'all'; use vars qw /%data %xls/; use constant {TRUE => -1,FALSE => 0}; use win32; use Win32::OLE; use Win32::OLE::Const; use DBD::ODBC; my $input = join (" ",@ARGV); my $Excel = Win32::OLE->GetActiveObject('Excel.Application') || Win32::OLE->new('Excel.Application'); # # if I add the following line; # my $xlConst = Win32::OLE::Const->Load('Microsoft Excel 8.0 Object Library'); # #I get this error: # #No type library matching "Microsoft Excel 8.0 Object Library" found at U:\go\test_for_raj2.pl line 18 #Win32::OLE(0.1701): GetOleTypeLibObject() Not a Win32::OLE::TypeLib object at C:/Perl/site/lib/Win32/OLE/Const.pm line 45. # my $Book = $Excel->Workbooks->Add; my $Sheet1 = $Book->Worksheets(1); $Sheet1->PageSetup->{Orientation} = 'xlLandscape'; # this is not working - nothing happens $Sheet1->PageSetup->{PaperSize} = 'xlPaperA3'; # this is not working - nothing happens $Sheet1->Range("A1:U1")->{MergeCells} = 1; $Sheet1->Cells(1,1)->Interior->{ColorIndex} = 50; $Sheet1->Cells(1,1)->Font->{bold} = 1; $Sheet1->Cells(1,1)->Font->{size} = 12; $Sheet1->Cells(1,1)->Font->{ColorIndex} = 6; $Sheet1->Cells(1,1)->{value}= "Seating ( ".$input." ) Exam Analysis - students seating Heat Map"; $Sheet1->Columns->AutoFit(); # this is not working - nothing happens $Sheet1->Range("A2:A7")->{MergeCells} = 1; $Sheet1->Cells(2,1)->Interior->{ColorIndex} = 20; $Sheet1->Cells(2,1)->{HorizontalAlignment} = 'xlHAlignCenter'; # this is not working # also want to make this cell text alignment vertical Center, horizontal left and wrap text $Sheet1->Cells(2,1)->Font->{bold} = 1; $Sheet1->Cells(2,1)->Font->{size} = 12; $Sheet1->Cells(2,1)->BorderAround('xlBorderLineStyleContinuous','xlThin',1); # this is not working - nothing happens $Sheet1->Cells(2,1)->{value}= "Function Groups"; $Sheet1->Range("B2:B7")->{MergeCells} = 1; $Sheet1->Cells(2,2)->Interior->{ColorIndex} = 20; # want to make this cell text alignment vertical Center, horizontal left and wrap text # AND text orientation at 74 degrees $Sheet1->Cells(2,2)->Font->{bold} = 1; $Sheet1->Cells(2,2)->Font->{size} = 12; $Sheet1->Cells(2,2)->BorderAround('xlBorderLineStyleContinuous','xlThin',1); # this is not working - nothing happens $Sheet1->Cells(2,2)->{value}= "Seats"; $Excel->{Visible} = 1;