Beruflich Dokumente
Kultur Dokumente
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
using Excel=Microsoft.Office.Interop.Excel;
namespace Cu_excel
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
System.Windows.Forms.TextBox[] tb = new
System.Windows.Forms.TextBox[10];
object mis = Type.Missing;
System.Globalization.CultureInfo oldCI =
System.Threading.Thread.CurrentThread.CurrentCulture;
Excel.Application xlApp = new Excel.Application();
xlApp.Visible = true;
//Excel.Workbook bb = xlApp.Workbooks.Open(c://optim.xls", mis,
mis, mis, mis, mis, mis, mis,
// mis, mis, mis, mis, mis, mis, mis);
if (textBox7.Text != "Save+Quit")
{ Excel.Workbook bb = xlApp.Workbooks.Open("c:\\Optim.xls",
mis, mis, mis, mis, mis, mis, mis, mis, mis, mis, mis, mis, mis, mis);
lungLine = s1.Length;
richTextBox1.Text = richTextBox1.Text + "\n" + s1;
if (lungLine == 0) break;
if (textBox7.Text == "Save+Quit")
{
bb.Save();
xlApp.Workbooks["Optim.xls"].Close(true, false,false);
//bb.SaveAs("c:/VVVV.xls", mis, mis,
// mis, mis,
mis,Microsoft.Office.Interop.Excel.XlSaveAsAccessMode.xlShared ,mis, mis,
mis, mis, mis);
// xlApp.Quit();
textBox7.Text = "Sav+Quit";
}
}
}
System.Threading.Thread.CurrentThread.CurrentCulture =
new System.Globalization.CultureInfo("en-US");
xlApp.Quit();
textBox7.Text = "Sav+Quit";
}
}
}
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Cu_Excel_23_m
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
int i,Row,Column; char c; string ss,s;
private void button1_Click(object sender, EventArgs e)
{
for (i = 0; i < 10; i++)
axSpreadsheet1.Cells.get_Item(1 + i, 1).Value2 = 2 * i;
axSpreadsheet1.Cells.get_Item(1, 2).Value2 = "=sum(A1:a20)";
textBox1.Text = axSpreadsheet1.Cells.get_Item(1,
2).Value2.ToString();
textBox2.Text = axSpreadsheet1.Cells.get_Item(1,
2).Formula.ToString();
c = '"'; ss = c.ToString();
Row = Convert.ToInt32(row.Text);
Column = Convert.ToInt32(col.Text);
axSpreadsheet1.Cells.get_Item(Row, Column).Value2 = "=sum(A1:a20)";
}
}
}