LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ted Ted is offline
external usenet poster
 
Posts: 48
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
exporting to excel camri6 Excel Discussion (Misc queries) 3 December 4th 08 08:30 AM
Trouble Exporting Word Questionaire into Excel Patrick I Excel Worksheet Functions 0 February 21st 08 01:59 PM
Exporting from Excel Secret Squirrel Excel Discussion (Misc queries) 1 February 8th 06 03:37 PM
Exporting to Excel Grady Excel Discussion (Misc queries) 1 December 27th 05 07:24 AM
Trouble exporting chart to htm file - need help Jacson Excel Programming 3 January 10th 04 07:22 AM


All times are GMT +1. The time now is 11:27 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"