开发者

Excel Interop Exception (2007 installed, Office.Interop.Excel used - ver 1.6 (12)) - 0x800A03EC HResult

Trying to 开发者_运维知识库make an excel file using this code:

app = new Excel.Application();
    app.Visible = false;
    object misValue = System.Reflection.Missing.Value;

    workbook = app.Workbooks.Add(misValue);
    worksheet = (Excel.Worksheet)workbook.Worksheets.get_Item(1);

and all get if I'm trying to do anything (worksheet.Cells[0,0] = "text") results in {"Exception from HRESULT: 0x800A03EC"}

I've tried changing the locale:

System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-US");

and I've tried also setting "Trust access to the VBA project object model" to true.

Nothing helps.

any ideas ?


Does this happen when you write to any other cell?

This is based off 2003, but I don't think you can write into cell 0,0. The start of the cell is 1,1 which is (A,1)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜