in reply to Reading Variables in Excel Spreadsheet
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;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Reading Variables in Excel Spreadsheet
by Anonymous Monk on Jan 15, 2018 at 15:46 UTC | |
by poj (Abbot) on Jan 15, 2018 at 16:13 UTC | |
by Anonymous Monk on Jan 15, 2018 at 16:50 UTC | |
by poj (Abbot) on Jan 15, 2018 at 16:54 UTC | |
by merrymonk (Hermit) on Jan 15, 2018 at 17:05 UTC | |
|