Sorting an Excel worksheet using VB.net

S

SharkTracker

I am trying to sort an Excel worksheet using Visual studio 2005 VB but cannot
seem to get the commands correct.

does anyone have the code or code structure that will allow me do this?
 
R

Rich P

If you are trying to sort an Excel worksheet that is open - that would
seem redundant. So I will suggest the following for either a closed
Excel worksheet, or an Excel worksheet you will be writing data to. In
either of these last two cases, you sort the data in the app first, and
then write that sorted data to the Excel sheet (Workbook). You will
have this Excel data in a dataTable in your VB.Net app. Use a dataview
object to sort the data and then write that sorted to Excel. I'm not
sure if or how well VS2005 supports Linq, but you can sort with Linq
also.

Rich
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top