public void SetAnchoColumna(int indice, DoubleValue ancho) { uint Index = (uint)indice; Columns cs = _workSheet.GetFirstChild <Columns>(); if (cs != null) { IEnumerable <Column> ic = cs.Elements <Column>().Where(r => r.Min == Index).Where(r => r.Max == Index); if (ic.Count() > 0) { Column c = ic.First(); c.Width = ancho; } else { Column c = new Column() { Min = Index, Max = Index, Width = ancho, CustomWidth = true }; cs.Append(c); } } else { cs = new Columns(); Column c = new Column() { Min = Index, Max = Index, Width = ancho, CustomWidth = true }; cs.Append(c); _workSheet.InsertAfter(cs, _workSheet.GetFirstChild <SheetFormatProperties>()); } }