How create an xls file with n sheets
-
Hi, my name is Silvia Terzi. I want create an Excel file with n sheets. I try to use this function: Sub CreateExcel Dim FileName As String FileName = "test.xsl" Response.Buffer = True Response.ContentType = "application/vnd.ms-excel" Response.AddHeader("content-disposition", "inline; ") FileName = " & FileName " Response.Write("<Worksheet ss:Name=""Sheet1"">") Response.Write("<table>") Response.Write("<tr>") For i = 1 To 15 Step 3 Response.Write("<td>") Response.Write(i * i) Response.Write("</td>") Next Response.Write("<td width=40><b>=somma(A1:D1)</b></td>") Response.Write("</tr>") Response.Write("</table>") Response.Write("</Worksheet>") Response.Write("<Worksheet ss:Name=""Sheet2"">") Response.Write("<table>") Response.Write("<tr>") For i = 1 To 15 Step 3 Response.Write("<td>") Response.Write(i * i) Response.Write("</td>") Next Response.Write("<td width=40><b>=somma(A1:D1)</b></td>") Response.Write("</tr>") Response.Write("</table>") Response.Write("</Worksheet>") Response.Flush() Response.End() End Sub But it doesn't work. It makes a file xls with only one sheet called like the file. What I mistake? Thanks, Silvia
-
Hi, my name is Silvia Terzi. I want create an Excel file with n sheets. I try to use this function: Sub CreateExcel Dim FileName As String FileName = "test.xsl" Response.Buffer = True Response.ContentType = "application/vnd.ms-excel" Response.AddHeader("content-disposition", "inline; ") FileName = " & FileName " Response.Write("<Worksheet ss:Name=""Sheet1"">") Response.Write("<table>") Response.Write("<tr>") For i = 1 To 15 Step 3 Response.Write("<td>") Response.Write(i * i) Response.Write("</td>") Next Response.Write("<td width=40><b>=somma(A1:D1)</b></td>") Response.Write("</tr>") Response.Write("</table>") Response.Write("</Worksheet>") Response.Write("<Worksheet ss:Name=""Sheet2"">") Response.Write("<table>") Response.Write("<tr>") For i = 1 To 15 Step 3 Response.Write("<td>") Response.Write(i * i) Response.Write("</td>") Next Response.Write("<td width=40><b>=somma(A1:D1)</b></td>") Response.Write("</tr>") Response.Write("</table>") Response.Write("</Worksheet>") Response.Flush() Response.End() End Sub But it doesn't work. It makes a file xls with only one sheet called like the file. What I mistake? Thanks, Silvia
-
Hi, my name is Silvia Terzi. I want create an Excel file with n sheets. I try to use this function: Sub CreateExcel Dim FileName As String FileName = "test.xsl" Response.Buffer = True Response.ContentType = "application/vnd.ms-excel" Response.AddHeader("content-disposition", "inline; ") FileName = " & FileName " Response.Write("<Worksheet ss:Name=""Sheet1"">") Response.Write("<table>") Response.Write("<tr>") For i = 1 To 15 Step 3 Response.Write("<td>") Response.Write(i * i) Response.Write("</td>") Next Response.Write("<td width=40><b>=somma(A1:D1)</b></td>") Response.Write("</tr>") Response.Write("</table>") Response.Write("</Worksheet>") Response.Write("<Worksheet ss:Name=""Sheet2"">") Response.Write("<table>") Response.Write("<tr>") For i = 1 To 15 Step 3 Response.Write("<td>") Response.Write(i * i) Response.Write("</td>") Next Response.Write("<td width=40><b>=somma(A1:D1)</b></td>") Response.Write("</tr>") Response.Write("</table>") Response.Write("</Worksheet>") Response.Flush() Response.End() End Sub But it doesn't work. It makes a file xls with only one sheet called like the file. What I mistake? Thanks, Silvia
Why open excel without sheet????, makes no sense to me, even if i open excel directly he always shows a new sheet. That's not possible and have no sense.
-
Why open excel without sheet????, makes no sense to me, even if i open excel directly he always shows a new sheet. That's not possible and have no sense.
Not without, with N! With a lot of sheets!