你看一下你的程序的Main函数,是不是如下的样式:[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}

解决方案 »

  1.   

    谢谢hbxtlhx,我知道不会提高速度,由于导出时间长,界面象死机了一样,所以想在后台用线程处理导出,这样界面就仍旧可以活动了您说的意思我有点不明白,因为我好象都没有Main()函数
    或者可以请教一下如何用后台线程处理导出吗?
    谢谢
      

  2.   

    先选择文件,文件选则好了,在起线程进行转换
    SaveFileDialog saveFileDialog1 = new SaveFileDialog();
                saveFileDialog1.FileName = fileName;
                saveFileDialog1.Filter = "excel文件(*.xls)|*.xls|所有文件|*.*";
                if (saveFileDialog1.ShowDialog() == DialogResult.OK)题(见下描述)
                {
                  System.Threading.Thread exportThread = new System.Threading.Thread(new System.Threading.ThreadStart(ExportRunning));
                exportThread.Start();            }