excel cell coloring

前端 未结 6 1799
刺人心
刺人心 2020-12-06 12:06

I am using c# to color particular cells of excel file. I am using:

Application excel = new Application();
Workbook wb = excel.Workbooks.Open(destPath);
 Work         


        
6条回答
  •  一个人的身影
    2020-12-06 12:11

    Exception from HRESULT: 0x800A03EC

    Solution: Change the misValue to sheet1, sheet2 or sheet3.

    xlWorkBook = xlApp.Workbooks.Add("sheet1"); 
    

    This works for me. system.reflaction.missing.value what was that, it is not related to Excel.workbooks.add came from a Excel file default value. When you create a Excel file, the default worksheets are sheet1, sheet2 and sheet3.

提交回复
热议问题