1

Using the method below I can load a row at time into an Excel file. Once all the rows are loaded into Excel.

A column holds alphanumeric characters,if cell content is numbers its aligned to left side otherwise aligned to right side.I need to always aligned to right side.

I would like change the format of cell to Text.

 private void AddExcelRows(string startRange, int rowCount,int colCount, object values) { _range = _sheet.get_Range(startRange, _optionalValue); _range = _range.get_Resize(rowCount, colCount); _range.set_Value(_optionalValue, values); } 

How can I set cell format as Text?

1 Answer 1

5

The text format is the '@' symbol, so:

_range.NumberFormat = "@"; 

should do the trick.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.