Export data to Excel

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • harmony123
    New Member
    • Apr 2010
    • 8

    Export data to Excel

    I would like to export data from textboxes to excel. i've added a reference excel 5.0 to my project and i have the following code.
    Code:
      Dim excelApp As New Excel._ExcelApplication
            Dim excelBook As Excel.Workbook = excelApp.Workbooks.Add(System.Reflection.Missing.Value)
            Dim excelWorksheet As Excel.Worksheet = _
            CType(excelBook.Worksheets(1), Excel.Worksheet)
            excelApp.Visible = True
    but i've been recieving this error: Member not found. (Exception from HRESULT: 0x80020003 (DISP_E_MEMBERN OTFOUND))

    any help would be appreciated...t nx tnx..
    Last edited by Frinavale; May 4 '10, 03:16 PM. Reason: Please post code in [code] ... [/code] tags. Added code tags.
  • robjens
    New Member
    • Apr 2010
    • 37

    #2
    Did you notice the whitespace in (V alue)
    I don't really see how you are using reflection though... You scan the form for fields and try to match them somehow or?

    Currently I'm just all Xml, all programs love it but it's anyone's poison. There are a 100 ways of doing this but I rarely see adresses like (0x80020003) pop up.

    By the way, it should be Excel.Applicati on so I wonder what the underscore is doing there plus the extra Excel.

    Comment

    Working...