I am working on a project that writes data to an Excel file.
Everything is finished now, however I need a few cells with a bigger size than the rest (title, etc).
I have read about this about the internet, but I keep having the same problem: when I execute my code (see below for what I have tried), everything in the worksheet becomes larger.
What I already have tried:
worksheet.Rows[1].Cells[7].Style.Font.Size = 20;
worksheet.get_Range("A7", "A7").Style.Font.Size = 20;
None of this seems to work; what is the correct way to increase a cell's font size?
I had to use:
I would just use:
edit: sorry, wrong brackets
If the data is consistent and will always be written to the same cells then this is the simplest solution - works well for product details / contact info type exporting
If the data varies and will sometimes be written to multiple rows/columns then something like this is more simple - works well for dataset / shopping list type exporting
When working with interop excel, try not to write your code with "two dots" in order to clean interop excel objects. This also helps having your code more readable. Anyway, to answer your question, and using what I have pointed out... all you have to do is: