Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
144283 | Apr 26,2019 01:03 PM UTC | Jun 19,2019 10:11 AM UTC | WinForms | 7 |
![]() |
Tags: XlsIO |
IWorkbook workbook = application.ActiveWorkbook; |
workbook.Activate(); |
using (ExcelEngine excelEngine = new ExcelEngine())
{
application = excelEngine.Excel;
IWorkbook workbook = application.Workbooks.Create(1);
_wb = application.ActiveWorkbook;
} |
string value = _wb.Worksheets[0].Range["A1"].Value; |
private void InitializeActiveWorkbook()
{
try
{
using (ExcelEngine excelEngine = new ExcelEngine())
{
application = excelEngine.Excel;
IWorkbook workbook = application.Workbooks.Create(1);
_wb = application.ActiveWorkbook;
_wb.Worksheets[0].Range["A1"].Value = "Testing"; // this does not set value to active workbook/worksheet cell.
string str = _wb.Worksheets[0].Range["A1"].Value = "Testing";
_wb.Worksheets.Create("TestWorksheetCreated");
}
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
}
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.