in reply to $chart->add_series ERROR

categories => '=Sheet1!$A$1:$A$\$rx', ## this works

Are you sure ? I don't see how it can with $rx in single quotes.

You need to provide a Short, Self-Contained, Correct Example like this

#!/usr/bin/perl use strict; use Excel::Writer::XLSX; my $workbook = Excel::Writer::XLSX->new( 'c:/temp/chart.xlsx' ); my $worksheet = $workbook->add_worksheet(); $worksheet->write_col( 0, 0,[ 'aa'..'zz' ] ); $worksheet->write_col( 0, 1,[ 1..26*26] ); my $chart = $workbook->add_chart( type => 'column' ); my $rx = 101; $chart->add_series( name => 'HISTOGRAM', categories => '=Sheet1!$A$1:$A$'.$rx, values => '=Sheet1!$B$1:$B$'.$rx, );
poj