in reply to Re^4: Excel Const - No type library matching error message
in thread Excel Const - No type library matching error message

Yes - it is on a user's system. My Perl applications reads from and writes to various spreadsheets. I also save copies of spreadsheets to pdf files. Also I know Excel is used to modify the spreadsheets that I read from.
Some of the Excel 'lines' I use successfully are below

eval { $excel = Win32::OLE->GetActiveObject( 'Excel.Application' ) }; eval { $workbook = $excel->Workbooks->Open($hist_full)}; $worksheet = $workbook->Worksheets($wksh_no); $$ref_cell_array = $worksheet->range($excel_data_range)->{'value'}; $close_res = $workbook->Close();

The odd thing is that 'Const' was not causing a problem and then it was reported as not working.

Replies are listed 'Best First'.
Re^6: Excel Const - No type library matching error message
by merrymonk (Hermit) on Dec 08, 2017 at 22:45 UTC
    Also, I should have said then when the following is run on the failing system I get the output underneath (just part of this is listed.

    use strict; my ($key); print "\nD Version test - Perl version is <$]>\n"; print "\n\nusing Win32::OLE::Const\n\n"; use Win32::OLE; use Win32::OLE::Const; my $Excel = Win32::OLE->new('Excel.Application', 'Quit'); my $xlcon = Win32::OLE::Const->Load($Excel); foreach $key (sort {$a cmp $b} keys %$xlcon) { print "$key value $xlcon->{$key}\n"; }

    D Version test - Perl version is <5.012002>


    using Win32::OLE::Const

    _xlDialogChartSourceData value 541
    _xlDialogPhonetic value 538
    rgbAliceBlue value 16775408
    rgbAntiqueWhite value 14150650
    rgbAqua value 16776960
    rgbAquamarine value 13959039
    rgbAzure value 16777200
    rgbBeige value 14480885
    rgbBisque value 12903679
    rgbBlack value 0
    rgbBlanchedAlmond value 13495295
    rgbBlue value 16711680

      On the failing system what does this give

      #!perl use strict; use Win32::OLE; print "Win32::OLE : $Win32::OLE::VERSION \n"; my $Excel = Win32::OLE->new('Excel.Application', 'Quit'); print "Excel ".$Excel->{Version};
      poj
        On the failing system the result of your Perl was

        Win32::OLE : 0.1709
        Excel 15.0

        Oddly I am told the same was obtained where the Const was successful.

        On my system, which is OK, the output was
        Win32::OLE : 0.1712
        Excel 14.0