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

I now have the results of running the test on two different systems with the same version of Perl.
On the system where the Const variants failed, nothing was printed out.

On the system where the Const was successful, the following was written out.

Microsoft Excel 15.0 Object Library C:\Program Files (x86)\Microsoft Office\Office15\EXCEL.EXE
AdHocReportingExcelClientLib C:\Program Files (x86)\Microsoft Office\Office15\ADDINS\Power View Excel Add-in\AdHocReportingExcelClient.dll
Microsoft Excel 15.0 Object Library C:\Program Files (x86)\Microsoft Office\Office15\EXCEL.EXE
AdHocReportingExcelClientLib C:\Program Files (x86)\Microsoft Office\Office15\ADDINS\Power View Excel Add-in\AdHocReportingExcelClient.dll

From this I gather that there is something missing from the failing system and that this may be something like the dll shown.
What is the simplest way to correct this? Is it as simple as copying the dll?
  • Comment on Re^3: Excel Const - No type library matching error message

Replies are listed 'Best First'.
Re^4: Excel Const - No type library matching error message
by poj (Abbot) on Dec 08, 2017 at 16:37 UTC

    Does the failing system have Excel installed ?

    poj
      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.
        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