473,385 Members | 1,325 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

C# and updating excel speadsheet

Hi,

Does anyone know how to sort an excel speadsheet? I have a C# app that does almost everything else but when I try and sort I get an ojbect reference error!

I have tried running excel and record a macro but the resulting code is uncomplete and only has 9 args and the C# will not run unless all are specified correctly.

...
oSheet.get_Range("A2", "M" + intLastRow).Select();

oSheet.Rows.Sort("A2", Excel.XlSortOrder.xlAscending, "E2", Type.Missing, Excel.XlSortOrder.xlAscending, "G2", Excel.XlSortOrder.xlAscending, Excel.XlYesNoGuess.xlNo ,0 , false, Excel.XlSortOrientation.xlSortRows,Excel.XlSortMet hod.xlPinYin, Excel.XlSortDataOption.xlSortNormal, Excel.XlSortDataOption.xlSortNormal,Excel.XlSortDa taOption.xlSortNormal);
...

Regards
Joolz
Jul 22 '08 #1
0 833

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Luis Esteban Valencia | last post by:
Hello Everyone, Iam an intermediate ASP.Net programmer and iam facing a challenging task. I have a table in MS-SQL server database called 'Members'. The table has following fields... ...
3
by: Mariusz | last post by:
Hi, I'm looking for some way to export data from my asp.net page to excel speadsheet. I'm generating some table containing raports and other tabular data and I need some way to export it to...
4
by: somanyusernamesaretakenal | last post by:
What I am trying to achieve: Basically I have generated a report in access. This report needs to be updated using excel. (Updating the new data, not changing existing data) What I did was I...
2
by: Rob Tackley | last post by:
Hi all, How can I check if I have an excel speadsheet already open? and if it is, how do I read write from it straight away? All I have managed to do is ensure that the excel spreadsheet is...
3
by: Rob Tackley | last post by:
-------------------------------------------------------------------------------- Hi all, How can I check if I have an excel speadsheet already open? and if it is, how do I read write from it...
3
by: oli insight | last post by:
I have an excel spreadsheet with 500 rows of information. I want to copy and paste that information into an access table that i'm using, column by column.... But access only lets me copy and paste...
7
by: MIkeC | last post by:
I am trying to open a specific Excel speadsheet so that I can load to a table. I am using VB6 in Citrix. The code works OK when run locally but simply closes down the application without a...
2
by: S_K | last post by:
Hi, I have a need to read data from an Excel spreadsheet using ASP.NET (C# ). The data is then displayed in various locations on the web site. This should be very simple and I have been...
5
by: Bill Schanks | last post by:
I have a winform app (VB 2005) that allows users to export data to excel, make updates to the excel file and import the data from that Excel file and update the database. My question is: Is it...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.