When I try this:
$worksheet1->write(0,1,"Modules", $format);
$worksheet1->write(0,2,"Excel");
$worksheet1->write(0,3, "Dumper");
It gives me this:
Modules Excel Dumper
and when I do this (which is your code)
$worksheet1->write(0,1,"Modules", $format);
$worksheet1->write(1,1,"Excel");
$worksheet1->write(2,1, "Dumper");
I get this:
Modules
Excel
Dumper
I think you just need to watch which index is for row and which is for column.
(EDITED because I misread and got backward what was desired vs. what you were getting)
Another EDIT:
and if I do this:
$worksheet1->write(0,0,"A1");
$worksheet1->write(0,1,"B1");
$worksheet1->write(0,2, "C1");
$worksheet1->write(1,0,"A2");
$worksheet1->write(1,1,"B2");
$worksheet1->write(1,2, "C2");
$worksheet1->write(2,0,"A3");
$worksheet1->write(2,1,"B3");
$worksheet1->write(2,2, "C3");
I get:
A1 B1 C1
A2 B2 C2
A3 B3 C3
Where each of the contents is also the name of the cell. Normally you'd do something like that with a nested loop
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.