自动粘贴系统剪切板的数据
public static string FilePath = @"D:\test\Excel\Test.xlsx";
public static string FilePath2 = @"D:\test\Excel\New Test.xls";
public static string TxtFilePath = @"D:\test\Excel\aaa.txt";
public static string SaveFilePath = @"D:\test\Excel\DataTable.xlsx";
public static string name;
public static int r = 0, c = 0;
[STAThread] //对指定一个STA线程操作
public static void Main(string[] args)
{
Console.WriteLine("數據處理完成!");
ybook = null;
ysheet = null;
yApp.Quit();
GC.Collect();
Console.WriteLine("按任意鍵退出...");
Console.ReadKey();
}
/// <summary>
///自动粘贴系统剪切板的数据方法
/// </summary>
public static void PastData()
{
Excel.Application yApp = new Excel.Application();
Excel.Workbook ybook = yApp.Workbooks.O