Excel Interop Range.BorderAround2 gives 0x80020003

0

I realise this means that this method is unsupported on the target machine, so that's fine, but how else can I get the same functionality?

If I use Range.Borders.LineStyle and Range.Borders.Weight then it doesn't put a border around the range, it will put borders around every individual cell inside the range (like a grid), which is not what I need.

The target machines use Office 2007. All other Office Interop code in my project works fine, just this.

c#
office-interop
asked on Stack Overflow Dec 17, 2012 by Ozzah

3 Answers

0

You can try this code:

sheet.Range["A1:D6"].BorderAround();
answered on Stack Overflow Dec 17, 2012 by (unknown user)
0

Try this it should work.

sheet.Range["A1:D6", Type.Missing].BorderAround();
answered on Stack Overflow Jun 16, 2014 by sportguitarRC
0

you can try this :

Excel.Application nouveau_excel = new Excel.Application();
nouveau_excel.get_Range("A1:K3").BorderAround(Excel.XlLineStyle.xlContinuous, Excel.XlBorderWeight.xlThick, Excel.XlColorIndex.xlColorIndexAutomatic, Color.Red);
answered on Stack Overflow Dec 17, 2015 by CodeKick

User contributions licensed under CC BY-SA 3.0