Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. How create an xls file with n sheets

How create an xls file with n sheets

Scheduled Pinned Locked Moved Web Development
xmlquestion
4 Posts 3 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    SIlviaTerzi
    wrote on last edited by
    #1

    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

    D N 2 Replies Last reply
    0
    • S SIlviaTerzi

      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

      D Offline
      D Offline
      dan sh
      wrote on last edited by
      #2

      Might help[^].

      जय हिंद

      1 Reply Last reply
      0
      • S SIlviaTerzi

        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

        N Offline
        N Offline
        Nelson Costa Inacio
        wrote on last edited by
        #3

        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.

        S 1 Reply Last reply
        0
        • N Nelson Costa Inacio

          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.

          S Offline
          S Offline
          SIlviaTerzi
          wrote on last edited by
          #4

          Not without, with N! With a lot of sheets!

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups