//the namespace you'll need to include, Project->Properties->Add New Reference
using namespace Microsoft::Office::Interop::Excel;
//This is your particular Excel instance
Excel::Application^ xl = gcnew Excel::Application();
//I like being able to see the sheet for simple programs
xl->Visible = true;
Excel::Workbook^ wb = xl->Workbooks->Open(Path2ExcelFile, Type::Missing, Type::Missing, Type::Missing, Type::Missing, Type::Missing, Type::Missing, Type::Missing, Type::Missing, Type::Missing, Type::Missing, Type::Missing, Type::Missing, Type::Missing, Type::Missing);
Excel::Worksheet^ ws1 = static_cast<Excel::Worksheet^>(wb->Sheets[SheetName1]);
Excel::Worksheet^ ws2 = static_cast<Excel::Worksheet^>(wb->Sheets[SheetName2]);
现在我们可以得到范围
Range^ rng1 = ws->Range["A1:C2","A1:C2"];
Range^ rng1 = ws->Range["F1:G2","F1:G2"];
这是获取单个单元格值的方法
String^ val1 = ws->Range["A1","A1"]->Value2->ToString();
然后是另一种获取单个单元格值的方法
ws->Range[((Excel::Range^)ws->Cells[(System::Object^)rowInteger, (System::Object^)columnInteger]), ((Excel::Range^)ws->Cells[(System::Object^)rowInteger, (System::Object^)columnInteger])]->Value2->ToString();