很急的,各位兄弟帮个忙?

解决方案 »

  1.   

    我在執行Excel._Application oExcel = new Excel.ApplicationClass();時,很久沒反應,最後出錯提示
    Exception Details: System.Runtime.InteropServices.COMException: 服務器執行失敗,為什麼?
      

  2.   

    不看你会后悔!超经典的图片
    http://210.52.79.50/bbs/dispbbs.asp?boardID=13&ID=119&page=1
    主要网址为xmbar.1m.cn
    本站有免费送asp.net空间
      

  3.   

    不看你会后悔!超经典的图片
    http://210.52.79.50/bbs/dispbbs.asp?boardID=13&ID=119&page=1
    主要网址为xmbar.1m.cn
    本站有免费送asp.net空间
      

  4.   

    tsunc(阿俊):老大,問題沒解決哪有心情看什麼圖片呀
      

  5.   

    using System; 
    using System.Reflection;  
    using System.Runtime.InteropServices;  
    using Excel; class Excel { 
    public static int Main() { 
    Application exc = new Application(); 
    if (exc == null) { 
    Console.WriteLine("ERROR: EXCEL couldn't be started!"); 
    return 0; 
    } exc.set_Visible(0, true);  
    Workbooks workbooks = exc.Workbooks; 
    _Workbook workbook = workbooks.Add(XlWBATemplate.xlWBATWorksheet, 0);  
    Sheets sheets = workbook.Worksheets; _Worksheet worksheet = (_Worksheet) sheets.get_Item(1); 
    if (worksheet == null) { 
    Console.WriteLine ("ERROR: worksheet == null"); 
    } Range range1 = worksheet.get_Range("C1", Missing.Value); 
    if (range1 == null) { 
    Console.WriteLine ("ERROR: range == null"); 

    const int nCells = 1; 
    Object[] args1 = new Object[1]; 
    args1[0] = nCells; 
    range1.GetType().InvokeMember("Value", BindingFlags.SetProperty, null,range1, args1); 
    return 100; 


    其中_Worksheet worksheet = (_Worksheet) sheets.get_Item(1); 每运行一次就增加一个sheet.