Try
poj#!perl use strict; use Win32::OLE 'in'; use Win32::OLE::Const 'Microsoft Excel'; $Win32::OLE::Warn = 3; # Die on Errors. # config my $dir = 'c:/temp/'; my $specfile = 'names.xlsx'; my $Excel = Win32::OLE->GetActiveObject('Excel.Application') || Win32::OLE->new('Excel.Application', 'Quit'); $Excel->{DisplayAlerts} = 0; #$Excel->{Visible} = 1; my $Book = $Excel->Workbooks->Open($dir.$specfile); # create named range my $range = $Book->Worksheets(1)->Range("A1"); $range->{'Name'} = "Any_name"; # no spaces # show named ranges for my $nm (in $Book->Names){ printf "%s %s\n", $nm->{'Name'},$nm->{'Value'}; } # close $Book->Close(); $Excel->Quit(); undef $Book; undef $Excel;
In reply to Re: Reading Variables in Excel Spreadsheet
by poj
in thread Reading Variables in Excel Spreadsheet
by merrymonk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |