# This is the code that works $mydata = [["Item", "Category", "Price"], ["Nails", "Hardware", "5.25"], ["Shirt", "Clothing", "23.00"]]; # Write all the data at once... $rng = $xlBook->ActiveSheet->Range("A1:C7"); $rng->{Value} = $mydata; # This is my code that doesn't work because I changed it to an array. @mydata = ("Item", "Category", "Price", "Nails", "Hardware", "5.25", "Shirt", "Clothing", "23.00"); # Write all the data at once... $rng = $xlBook->ActiveSheet->Range("A1:C7"); $rng->{Value} = @mydata; #### use Win32::OLE; # Start Excel and make it visible $xlApp = Win32::OLE->new('Excel.Application'); $xlApp->{Visible} = 1; # Create a new workbook $xlBook = $xlApp->Workbooks->Add; # Our data that we will add to the workbook... $mydata = [["Item", "Category", "Price"], ["Nails", "Hardware", "5.25"], ["Shirt", "Clothing", "23.00"], ["Hammer", "Hardware", "16.25"], ["Sandwich", "Food", "5.00"], ["Pants", "Clothing", "31.00"], ["Drinks", "Food", "2.25"]]; # Write all the data at once... $rng = $xlBook->ActiveSheet->Range("A1:C7"); $rng->{Value} = $mydata; print "All done.";