View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
[email protected] crferguson@gmail.com is offline
external usenet poster
 
Posts: 91
Default Block copy of Datatable to Excel Spreadsheet using C#

I'm not sure exactly what the code would be in C#, but all you need is
to get the excel workbook object and then set an array equal to the
range of cells you're wanting to pull. Assuming you already have the
workbook object (let's say MyWorkbook) since you're already pulling
cell by cell:

Dim arrRange
arrRange = MyWorkbook.Range("A1:C10")


On Oct 30, 8:33 am, Peter S. wrote:
I am currently copying data from a DataTable to an Excel spreadsheet on a
cell by cell basis. I would like to speed things up by doing this on a row by
row basis or one big block copy. I can't seem to be able to figure out on how
to do this on a row by row basis or by one single command. Can anyone supply
a snippet of how this can be performed? Thanks!