Windows Phone Developers

Showing posts with label VSTO Array to Range. Show all posts
Showing posts with label VSTO Array to Range. Show all posts

Tuesday, November 25, 2008

Insert Array to Excel Range using VSTO

Copy Array Values to Excel Range using VSTO

Many times we need to insert text to a contiguous Excel range using VSTO (like column headings). The following code does exactly that

private void InsertHeading()

{

string[] Header = { "Sno", "Product Code", "Product Name", "Quanity", "Price", "Total" };

Excel.Worksheet sht = Globals.ThisAddIn.Application.ActiveSheet as Excel.Worksheet;

Excel.Range myHeader = sht.get_Range("A1", "F1");

myHeader.Value2 = Header;

myHeader.Columns.AutoFit();

}


See Also

How to use .Net Array.Sort Function in VBA

Convert Dates to Arrays using Array Function

Object Arrays in C# using Indexers

Insert CSV File to Array using C#

Creating and Sorting Arrays in C#

Split Function in Visual Basic .Net

Digg Technorati Delicious StumbleUpon Reddit BlinkList Furl Mixx Facebook Google Bookmark Yahoo
ma.gnolia squidoo newsvine live netscape tailrank mister-wong blogmarks slashdot spurl StumbleUpon