ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Obtain Value in sheet from C# (https://www.excelbanter.com/excel-programming/394868-obtain-value-sheet-c.html)

Robert[_32_]

Obtain Value in sheet from C#
 
I am opening an Excel Workbook from C# (VS2005) and I need to get a value
from a Spreadsheet before closing the C# application. Does anyone know if
this can be done? Here is the code to open the Workbook:

//Open the Excel Spreadsheet
Microsoft.Office.Interop.Excel.Application excelApp = new
Microsoft.Office.Interop.Excel.ApplicationClass();
excelApp.Visible = true;
string workbookPath = @"\\path\file$\folder\AssignmentTest.xls";
Microsoft.Office.Interop.Excel.Workbook excelWorkbook =
excelApp.Workbooks.Open(workbookPath,
0, false, 5, "password", "", true,
Microsoft.Office.Interop.Excel.XlPlatform.xlWindow s, "",
true, false, 0, true, false, false);
--
Robert Hill



All times are GMT +1. The time now is 09:23 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com