2
Answers

Bold 1st Row in Excel Via C#

Photo of Indigo Montoya

Indigo Montoya

12y
19.2k
1
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)