मेरी समस्या है कि मैं एक कार्यक्रम पढ़ता है कि एक एक्सेल शीट से डेटा .xlsb, लेकिन जब Excel फ़ाइल खुला है, तो यह मुझसे पूछता है के लिए बचाने के लिए । क्यों?
async Task<bool> ReadVariable()
{
bool succeeded = false;
while (!succeeded)
{
//open file excel using microsoft dll
Excel.Application app = new Excel.Application();
//open workbook
Workbook wk = app.Workbooks.Open(excelpath, ReadOnly : true);
//get first sheet
Worksheet sh = wk.Worksheets[1];
//get cell
// Cells[unten/rechts] Example: [1,2] = B1
var day1tag = sh.Cells[27, 2].Value.ToString();
exceltest1.Text = day1tag;
var day1früh = sh.Cells[26, 2].Value.ToString();
Day24oee24.Text = day1früh;
app.DisplayAlerts = false;
wk.Close(SaveChanges : false);
app.Quit();
await Task.Delay(15000);
//await Task.Delay(108000000);
}
return succeeded;
}