VB.NET - VB.Net copy an array to a excel spreadsheet

Asked By C P on 26-Jul-13 07:26 AM
I have created an array in VB and want to copy the whole array to an excel spreadsheet rather than doing it a line at a time. This will make the process much quicker.

The array code at VB end is like as follows

xlWorkSheet.Range("A2").Resize(x, y).Value = MyArray

The excel spreadsheet has headings

Name, Dept, Salary

Rather than being dispalyed as

Name Dept Salary
Smith Accounts 10000
Green Sales 14500
Brown Accounts 12000

It is getting displayed as

Name Dept Salary
Smith Green Brown
Accounts Sales Accounts
10000 14500 12000

There must be a simple solution?