CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Guest

    Dumping Data into Excel

    I have an array of data which I would like to dump into an excel file, how is this done ?


  2. #2
    Guest

    Re: Dumping Data into Excel

    Finally, something I can help with.
    This is the code I use to dump to Excel, don't expect it to be the most
    efficient since I am also a beginner programmer but it works fine:

    Private Sub Command1_Click()
    Set wkbObj = GetObject("C:\VBProjects\Path\File.XLS")
    Dim i As Integer
    E(40) = CDbl(wkbObj.Worksheets(1).Range("B1").Value)
    End Sub

    Private Sub Command2_Click()
    Set wkbObj = GetObject("C:\VBProjects\Path\File.XLS")

    Dim i As Integer
    wkbObj.Worksheets(1).Range("B1").Value = E(40)
    wkbObj.SaveAs "C:\VBProjects\HobVB\Hob.XLS"
    End Sub

    You will have to Reference Microsoft Excel Object Library.

    I think that will wowk for dumping the variables, if you want to display them in your VB Project you will have to set-up the ADO Link (see Ch.7 VB Programmer's Guide)


  3. #3
    Guest

    Re: Dumping Data into Excel

    Thanks for your help.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured