-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExcel.cs
More file actions
37 lines (33 loc) · 894 Bytes
/
Copy pathExcel.cs
File metadata and controls
37 lines (33 loc) · 894 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
using Microsoft.Office.Interop.Excel;
using System;
using _Excel = Microsoft.Office.Interop.Excel;
namespace SeleniumBot
{
class Excel
{
string path = "";
_Application excel = new _Excel.Application();
Workbook wb;
Worksheet ws;
public Excel(String path, int Sheet)
{
this.path = path;
excel.Visible = true;
wb = excel.Workbooks.Open(path, 0, false, 5, "", "", false,
XlPlatform.xlWindows, "", true, false, 0, true, false, false);
ws = wb.Worksheets[Sheet];
}
public void Write(int i, int j, string s)
{
ws.Cells[i, j].Value2 = s;
}
public void Writeint(int i, int j, double s)
{
ws.Cells[i, j].Value2 = s;
}
public void save()
{
wb.Save();
}
}
}