Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Trouble exporting ado rs to Excel
Hi, I am having trouble as a newbee. I am trying to export the dataset to
excel spread sheet. But I am unsure what the recordset object is called in ..net. Here is what I have so far: Private Sub ExportToExcel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExportToExcel.Click Dim excel As Microsoft.Office.Interop.Excel.Application Dim wb As Microsoft.Office.Interop.Excel.Workbook Dim ws As Microsoft.Office.Interop.Excel.Worksheet Dim rng As Microsoft.Office.Interop.Excel.Range Try excel = New Microsoft.Office.Interop.Excel.Application wb = excel.Workbooks.Add() ws = wb.ActiveSheet() ws.Range("A1").CopyFromRecordset excel.Visible = True wb.Activate() 'Catch ex As COMExceptionMessageBox.Show("Error accessing Excel: " + ex.ToString()) 'Catch ex As ExceptionMessageBox.Show("Error: " + ex.ToString()) Finally End Try End Sub I appoligize but like I said I am new, Can anyone help me out. Thanks, Ted |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
exporting to excel | Excel Discussion (Misc queries) | |||
Trouble Exporting Word Questionaire into Excel | Excel Worksheet Functions | |||
Exporting from Excel | Excel Discussion (Misc queries) | |||
Exporting to Excel | Excel Discussion (Misc queries) | |||
Trouble exporting chart to htm file - need help | Excel Programming |