Creating an Excel Spreadsheet from code on a computer that does nothave Excel installed

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • zacks@construction-imaging.com

    #1

    Creating an Excel Spreadsheet from code on a computer that does nothave Excel installed

    I have an application that can read an Excel spreadsheet on a computer
    that doesn't have Excel installed on using the Jet ODBC 4.0 driver.

    I know need to modify the application to also be able to create a new
    Excel spreadsheet and write data to it on the same computer, a
    computer that does not have Excel, or even Office installed.

    I have done some research on this and it appears it cannot be done.

    Can anyone verify that or better yet, point me to a link that explains
    how to do it?
  • Trevor Benedict

    #2
    Re: Creating an Excel Spreadsheet from code on a computer that does not have Excel installed

    would you consider Excel XML.



    Regards,

    Trevor Benedict

    MCSD

    <zacks@construc tion-imaging.comwrot e in message
    news:365befe8-bdc3-4a01-8e1c-283ee71ee3d6@e2 5g2000prg.googl egroups.com...
    >I have an application that can read an Excel spreadsheet on a computer
    that doesn't have Excel installed on using the Jet ODBC 4.0 driver.
    >
    I know need to modify the application to also be able to create a new
    Excel spreadsheet and write data to it on the same computer, a
    computer that does not have Excel, or even Office installed.
    >
    I have done some research on this and it appears it cannot be done.
    >
    Can anyone verify that or better yet, point me to a link that explains
    how to do it?

    Comment

    • Michel Posseth  [MCP]

      #3
      Re: Creating an Excel Spreadsheet from code on a computer that does not have Excel installed

      Well you can write data files with a xls extension that will inmediatly be
      converted by Excel when openned ( the user will not notice this )
      this works for me ( office 2003 and higher )

      if this might work for you i can show an example



      hth

      Michel



      <zacks@construc tion-imaging.comschr eef in bericht
      news:365befe8-bdc3-4a01-8e1c-283ee71ee3d6@e2 5g2000prg.googl egroups.com...
      >I have an application that can read an Excel spreadsheet on a computer
      that doesn't have Excel installed on using the Jet ODBC 4.0 driver.
      >
      I know need to modify the application to also be able to create a new
      Excel spreadsheet and write data to it on the same computer, a
      computer that does not have Excel, or even Office installed.
      >
      I have done some research on this and it appears it cannot be done.
      >
      Can anyone verify that or better yet, point me to a link that explains
      how to do it?

      Comment

      • zacks@construction-imaging.com

        #4
        Re: Creating an Excel Spreadsheet from code on a computer that doesnot have Excel installed

        On Jan 28, 5:03 pm, "Michel Posseth [MCP]" <M...@posseth.c omwrote:
        Well you can write data files with a xls extension that will inmediatly be
        converted by Excel when openned  ( the user will not notice this )
        this works for me ( office 2003 and higher  )
        >
        if this might work for you i can show an example
        I would like to see that please.
        >
        hth
        >
        Michel
        >
        <za...@construc tion-imaging.comschr eef in berichtnews:365 befe8-bdc3-4a01-8e1c-283ee71ee3d6@e2 5g2000prg.googl egroups.com...
        >
        >
        >
        I have an application that can read an Excel spreadsheet on a computer
        that doesn't have Excel installed on using the Jet ODBC 4.0 driver.
        >
        I know need to modify the application to also be able to create a new
        Excel spreadsheet and write data to it on the same computer, a
        computer that does not have Excel, or even Office installed.
        >
        I have done some research on this and it appears it cannot be done.
        >
        Can anyone verify that or better yet, point me to a link that explains
        how to do it?

        Comment

        • Michel Posseth  [MCP]

          #5
          Re: Creating an Excel Spreadsheet from code on a computer that does not have Excel installed


          Well one method i personally like an use a lot is this one

          Imports System.Web

          Imports System.IO


          Private Sub CreateXLSFromDt (ByVal ds As DataSet, ByVal tablename As String,
          ByVal location As String)
          Dim grid As New System.Web.UI.W ebControls.Data Grid

          grid.HeaderStyl e.Font.Bold = True

          grid.DataSource = ds

          grid.DataMember = tablename

          grid.DataBind()

          '// render the DataGrid control to a file

          Using sw As New StreamWriter(lo cation)

          Using hw As New UI.HtmlTextWrit er(sw)

          grid.RenderCont rol(hw)

          End Using

          End Using

          End Sub

          usage

          CreateXLSFromDt (dataset, TableNameInData set , fullpath of file to create )

          so in my situation
          CreateXLSFromDt (dsBl, "tblBlok", "C:\testMp.xls" ) '


          you just throw in a dataset and it will render the table data to a nicely
          formated ( table with headers ) Excel sheet


          Hope this works for you to

          Michel




          <zacks@construc tion-imaging.comschr eef in bericht
          news:58fa4351-6ab5-4fdc-a3db-1e670979e6b4@u1 0g2000prn.googl egroups.com...
          On Jan 28, 5:03 pm, "Michel Posseth [MCP]" <M...@posseth.c omwrote:
          Well you can write data files with a xls extension that will inmediatly be
          converted by Excel when openned ( the user will not notice this )
          this works for me ( office 2003 and higher )
          >
          if this might work for you i can show an example
          I would like to see that please.
          >
          hth
          >
          Michel
          >
          <za...@construc tion-imaging.comschr eef in
          berichtnews:365 befe8-bdc3-4a01-8e1c-283ee71ee3d6@e2 5g2000prg.googl egroups.com...
          >
          >
          >
          I have an application that can read an Excel spreadsheet on a computer
          that doesn't have Excel installed on using the Jet ODBC 4.0 driver.
          >
          I know need to modify the application to also be able to create a new
          Excel spreadsheet and write data to it on the same computer, a
          computer that does not have Excel, or even Office installed.
          >
          I have done some research on this and it appears it cannot be done.
          >
          Can anyone verify that or better yet, point me to a link that explains
          how to do it?

          Comment

          Working...