Question Sorting data for use within a.net program

Tech_Gronk

New member
Joined
Mar 25, 2011
Messages
1
Programming Experience
Beginner
Hi, I have good experience in excel vba but i am new to .net so please excuse me if my stupidity becomes apparent.

I would like to utilize some excel addin data (about 5 worksheets of 1000 rows) in a .net program. Is there a way of storing that data within the .net program or some other means so that it can be accessed by the program. Any advice would be welcome. thankyou
 
You can use Imports Excel = Microsoft.Office.Interop.Excel to interact with Excel.

You could use an ArrayList to store the data in .NET if need be.
 
Here is some sample .NET code I used to sort an excel sheet. Naturally you could read the data into a dataset or something like that and sort within .NET:

VB.NET:
                Dim xlRange As Excel.Range = xlSheetFG.Rows(xlRowFG(x) & ":" & IIf(x = 6, xlRowFG(x + 1) - 1, xlRowFG(x + 1) - 4))
                xlRange.Sort(xlRange.Columns(13), Excel.XlSortOrder.xlDescending, Header:=Excel.XlYesNoGuess.xlNo, _
                            OrderCustom:=1, MatchCase:=False, _
                            Orientation:=Excel.XlSortOrientation.xlSortColumns, _
                            DataOption1:=Excel.XlSortDataOption.xlSortNormal)
 
Back
Top