Indigo Montoya

Indigo Montoya

  • NA
  • 7
  • 22.5k

Bold 1st Row in Excel Via C#

Dec 22 2012 2:47 PM
Is it possible to bold the 1st row in an Excel file via C# -- of course this file is open.

I have tried
Excel.Application oXL;
myWorkBk = oXL.Workbooks.Add(missingValue);
myWorkSht = (Excel.Worksheet)myWorkBK.Worksheets.get_Item(1);

myWorkSht.get_Range(myWorkSht.Cells[1,1], myWorkSht.Cells[1,7].Font.Bold = true;

but this throws a COM Exception.  Anyone have any other thoughts?

Answers (2)