Excel In VB.net

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Atley

    #1

    Excel In VB.net

    I am trying to create a new spreadsheet in Excel using VB.net 2003.

    This application has to be useable by a range of users running anywhere from
    Excel 2000 to Excel XP to Excel 2003.

    My dev machine has Excel 2003.

    How do I get the libraries for the earlier version of Excel? VB.net 2003
    has Excel 5.0 library in it, but I cannot find any documentation on that
    particular library set anywhere. It doesn't allow me to put information in
    my Cells, it tells me that they are values and are not editable, plus I get
    'Member Not Found' errors when trying to make new workbooks or worksheets.

    I am very familiar with programming for the newer versions of Excel
    (2000-2003). What are my options here?

    I don't want to have to install an older version on my dev machine, and I do
    not want to have to try and program this app on a differenet machine.

    Does anyone have an example of basic sheet creation and formatting in VB.net
    for the older 5.0 library? That would be greatly appreciated.


  • brix_zx2

    #2
    RE: Excel In VB.net

    ..Net 2k3 has Excel 8.0 which works with 2000 and up

    "Atley" wrote:
    [color=blue]
    > I am trying to create a new spreadsheet in Excel using VB.net 2003.
    >
    > This application has to be useable by a range of users running anywhere from
    > Excel 2000 to Excel XP to Excel 2003.
    >
    > My dev machine has Excel 2003.
    >
    > How do I get the libraries for the earlier version of Excel? VB.net 2003
    > has Excel 5.0 library in it, but I cannot find any documentation on that
    > particular library set anywhere. It doesn't allow me to put information in
    > my Cells, it tells me that they are values and are not editable, plus I get
    > 'Member Not Found' errors when trying to make new workbooks or worksheets.
    >
    > I am very familiar with programming for the newer versions of Excel
    > (2000-2003). What are my options here?
    >
    > I don't want to have to install an older version on my dev machine, and I do
    > not want to have to try and program this app on a differenet machine.
    >
    > Does anyone have an example of basic sheet creation and formatting in VB.net
    > for the older 5.0 library? That would be greatly appreciated.
    >
    >
    >[/color]

    Comment

    • Atley

      #3
      Re: Excel In VB.net

      Actually, (I just checked in my COM References) I only have:
      Microsoft Excel 5.0 Object Library (VB.net)
      and
      Microsoft Excel 11.0 Object Library (Office 2003)
      avaliable to me... is there a service pack or an update that would give me
      the 8.0 OL? that would be ideal.

      I have Visual Studio .net 2003 Enterprise Arch.

      Thanks for the feedback.



      "brix_zx2" <brixzx2@discus sions.microsoft .com> wrote in message
      news:389AB35B-11C7-430E-99BE-A461C98656E3@mi crosoft.com...[color=blue]
      > .Net 2k3 has Excel 8.0 which works with 2000 and up
      >
      > "Atley" wrote:
      >[color=green]
      > > I am trying to create a new spreadsheet in Excel using VB.net 2003.
      > >
      > > This application has to be useable by a range of users running anywhere[/color][/color]
      from[color=blue][color=green]
      > > Excel 2000 to Excel XP to Excel 2003.
      > >
      > > My dev machine has Excel 2003.
      > >
      > > How do I get the libraries for the earlier version of Excel? VB.net[/color][/color]
      2003[color=blue][color=green]
      > > has Excel 5.0 library in it, but I cannot find any documentation on[/color][/color]
      that[color=blue][color=green]
      > > particular library set anywhere. It doesn't allow me to put information[/color][/color]
      in[color=blue][color=green]
      > > my Cells, it tells me that they are values and are not editable, plus I[/color][/color]
      get[color=blue][color=green]
      > > 'Member Not Found' errors when trying to make new workbooks or[/color][/color]
      worksheets.[color=blue][color=green]
      > >
      > > I am very familiar with programming for the newer versions of Excel
      > > (2000-2003). What are my options here?
      > >
      > > I don't want to have to install an older version on my dev machine, and[/color][/color]
      I do[color=blue][color=green]
      > > not want to have to try and program this app on a differenet machine.
      > >
      > > Does anyone have an example of basic sheet creation and formatting in[/color][/color]
      VB.net[color=blue][color=green]
      > > for the older 5.0 library? That would be greatly appreciated.
      > >
      > >
      > >[/color][/color]


      Comment

      • sionnach
        New Member
        • May 2006
        • 1

        #4
        Atley,
        You’ve probably long since solved this problem, but for anyone who’s interested: An Excel file can be created using a tab separated flat file (should work in all versions of Excel, right back to 95)… in VB.NET, something like this:

        Imports System.IO
        Imports System.Text
        ………..

        Dim strPath As String = "c:\test.xl s"

        ' Delete the file if it exists.
        If File.Exists(str Path) Then File.Delete(str Path)

        Dim sw As StreamWriter = File.CreateText (strPath)

        sw.WriteLine("H eader A" & vbTab & "Header B")
        sw.WriteLine("1 a" & vbTab & "1b")
        sw.WriteLine("2 a" & vbTab & "2b")
        sw.Flush()
        sw.Close()

        Comment

        Working...