简体   繁体   中英

Little Confused about the Microsoft Excel Interop Library

I know how to make new columns, I know how to add a header to that column, but I am a little unsure about adding values programatically.

I am going to be looping through rows and then adding values to the new columns that I create based on some functions I perform on the Data Set. I thought a good way to start would be to just pick a row and loop through it and print out all the information in that row. If I could figure out how to do that, I could probably right all the code necessary to loop through appropriate rows and get the data I need. But I am a little confused about how to use this Range object...

    Range rng = (Range)wkSheet.get_Range("A1", Type.Missing);

Lets say I wanted to print out all the Range Row information to a console? How would I loop through that Range and print out that information? Even change the information in the Range. I know how to change the value of a single row, the header, but changing multiple rows is alluding me.

object[,] values = (object[,])rng.Value;

可能重复从Excel读取

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM