using System;
using System.Globalization;
using System.IO;
using System.Windows.Forms;
using Excel = Microsoft.Office.Interop.Excel;
namespace Таблица_для_расчетов
{
public partial class FillCon : UserControl
{
public FillCon()
{
InitializeComponent();
comboBox1.SelectedIndex = 0;
comboBox1.DropDownStyle = ComboBoxStyle.DropDownList;
comboBox2.SelectedIndex = 0;
comboBox2.DropDownStyle = ComboBoxStyle.DropDownList;
comboBox3.SelectedIndex = 0;
comboBox3.DropDownStyle = ComboBoxStyle.DropDownList;
comboBox4.SelectedIndex = 0;
comboBox4.DropDownStyle = ComboBoxStyle.DropDownList;
comboBox5.SelectedIndex = 3;
comboBox5.DropDownStyle = ComboBoxStyle.DropDownList;
Timer();
OpenExcel();
}
private void Timer()
{
timer = new Timer();
timer.Interval = 100;
timer.Tick += TimerEvent;
timer.Start();
}
private Timer timer;
public Excel.Application application;
public Excel.Workbook workBook;
public Excel.Worksheet workSheet;
public Excel.Worksheet workSheet2;
public Excel.Worksheet workSheet3;
public int developmentWithDZ = 0; // Не было использовано
public string recruit;
public string award;
public string office;
public string transcript;
public string roomUgoschService;
public string superb;
public string moderator; // Не было использовано
public string guide; // Не было использовано
public string k;
public string guideMain;
public string res;
public string Res
{
get { return res; }
set { res = value; }
}
public void OpenExcel()
{
application = new Excel.Application();
//application.Visible = true;
workBook = application.Workbooks.Open(Path.Combine(Environment.CurrentDirectory, "Files\\Таблица для расчетов.xlsx")); // ВЫЗОВ ОШИБКИ
workSheet = workBook.Worksheets[1];
workSheet2 = workBook.Worksheets[2];
}