|
Hello,
I would read all lines of my excel file, can you help me? thank you verry mutch.
|
|
|
|
|
Read the previous post, that's about writing Excel. Reading is done in roughly the same way.
You can Google for examples if you like
I are troll
|
|
|
|
|
Hello ,
I try for :
<br />
Microsoft.Office.Interop.Excel.Application excelApplication = null;<br />
Microsoft.Office.Interop.Excel.Workbook workbook = null;<br />
Microsoft.Office.Interop.Excel.Worksheet worksheet = null;<br />
<br />
excelApplication = new Microsoft.Office.Interop.Excel.Application();<br />
excelApplication.Visible = false;<br />
<br />
workbook = excelApplication.Workbooks.Open(@"D:\Après\mailing_RA_20090219.xls", 0, false, 5, "", "", false, Microsoft.Office.Interop.Excel.XlPlatform.xlWindows, "", true, false, 0, true, false, false);<br />
worksheet = (Microsoft.Office.Interop.Excel.Worksheet)workbook.Worksheets[2];<br />
<br />
<br />
<br />
<br />
excelApplication.Quit();<br />
excelApplication = null;<br />
<br />
string cellValue = "";<br />
object cellObject = null;<br />
Microsoft.Office.Interop.Excel.Range range = null;<br />
<br />
<br />
range = (Microsoft.Office.Interop.Excel.Range)worksheet.Cells[3,2];<br />
<br />
cellObject = range.get_Value(null);<br />
cellValue = (cellObject == null ? "" : cellObject.ToString().Trim());<br />
<br />
<br />
Console.WriteLine(cellValue);<br />
i have the exception on : range = (Microsoft.Office.Interop.Excel.Range)worksheet.Cells[3,2];, thank you verry mutch.
|
|
|
|
|
Is there a chart in that range of cells?
I are troll
|
|
|
|
|
Yes, I have 1506 rows and 10 collumns, thank you verry mutch.
|
|
|
|
|
If there's a graphic or a chart at cell 3,2 then you won't be able to convert this to a string. That's seems to be the main problem when you Google for the error-code.
Furthermore, you're closing the Excel-application before you're reading, on these lines;
excelApplication.Quit();
excelApplication = null;
Is that as it was intended?
I are troll
|
|
|
|
|
Thank you,
i try :
<br />
Microsoft.Office.Interop.Excel.Application excelApplication = null;<br />
Microsoft.Office.Interop.Excel.Workbook workbook = null;<br />
Microsoft.Office.Interop.Excel.Worksheet worksheet = null;<br />
<br />
excelApplication = new Microsoft.Office.Interop.Excel.Application();<br />
excelApplication.Visible = false;<br />
try<br />
{<br />
workbook = excelApplication.Workbooks.Open(@"D:\Après\mailing_RA_20090219.xls", 0, false, 5, "", "", false, Microsoft.Office.Interop.Excel.XlPlatform.xlWindows, "", true, false, 0, true, false, false);<br />
worksheet = (Microsoft.Office.Interop.Excel.Worksheet)workbook.Worksheets[2];<br />
<br />
<br />
<br />
<br />
<br />
<br />
string cellValue = "";<br />
object cellObject = null;<br />
Microsoft.Office.Interop.Excel.Range range = null;<br />
<br />
<br />
range = (Microsoft.Office.Interop.Excel.Range)worksheet.Cells[4,7];<br />
<br />
cellObject = range.get_Value(null);<br />
cellValue = (cellObject == null ? "" : cellObject.ToString().Trim());<br />
<br />
Console.WriteLine(cellValue);<br />
<br />
excelApplication.Quit();<br />
excelApplication = null;<br />
<br />
Console.Read();<br />
<br />
<br />
<br />
<br />
}<br />
catch (Exception ex)<br />
{<br />
Console.WriteLine(ex.ToString());<br />
Console.Read();<br />
}<br />
But i have an empty output, thank you verry mutch.
|
|
|
|
|
Sounds like two monologues intertwined...
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
I don't find any thing.please help me thank you verry mutch.
|
|
|
|
|
I'm sorry, but I got no clue how
I are troll
|
|
|
|
|
/*excelApplication.Quit();
excelApplication = null;
string cellValue = "";
object cellObject = null;
Microsoft.Office.Interop.Excel.Range range = null;*/
remove this code Bro
|
|
|
|
|
I am trying to convert xml data to Excel. But, I am not able to figure out how to create a excel by C#. Pls help me.
|
|
|
|
|
link[^]
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
|
AFAIK, that's a hyperlink that points to Google. There are a lot of articles explaining how to export to Excel.
Excel can read "Comma separated" files, where each line is a row in Excel, and each value (separated by a comma) is a column.
You can also use ODBC to write Excel files, you can go to ConnectionStrings.com[^] to get a connectionstring for Excel.
..and there are some articles on InterOp and stuff. Enjoy
I are troll
|
|
|
|
|
|
hi
i got link breaks from google chached pages
Example.
if one click on the link which is chached in google (www.mysite-problem.com/default..aspx) showing the error
HTTP Error 400 - Bad Request.
here i want to replace ".." with "."
or how can i redirect my page to if this error accured.
thanks in Advance
max
modified on Friday, March 13, 2009 8:58 AM
|
|
|
|
|
Don't you think the question is completely out of context ??????????
-Regards
Bharat Jain
bharat.jain.nagpur@gmail.com
|
|
|
|
|
hi Bharat
once will u check dis url
http://www.submitedge.com/hotels-london..com
u will get what exactly i need
|
|
|
|
|
That's a SEO-firm, and they have live support. Why not ask them why they're hosting files that have a .com extension?
I are troll
|
|
|
|
|
me an computer science student.as part of my completion of course
i prefer to do a project on this topic for 6 months.is this enough
for 6 months to do?How many modules should come under this project?
is it difficult to complete in 6 months?which programming language
is better to do this project?
|
|
|
|
|
I'd use vbscript to do this.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
i'd be careful with Jhon's answer previously, he has a habbit of joshing with people.
Unfortunatly, the registry has been intentionally obfiscated to make it nearly impossible to create even the most redimentry of tools. Your only hope would be to use a low level machine code language, try this[^]
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
I only do that to people that ask stupid questions.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
John Simmons / outlaw programmer wrote: I only do that to people that ask stupid questions.
Wow! Who knew?
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|