in reply to Generating an Excel chart

Print out the argument to categories and see if it matches what you want:

print "\'=Sheet1!$A$rowbegin:$A$rowend\'", "\n";

You probably want to not interpolate $A, and the ' in there are wrong too. So something like "Sheet1!\$A$rowbegin:\$A$rowend"

And remember to always use strict; use warnings;