• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 509
  • Last Modified:

Setting Excel Font from C#

Hello,

I'm creating a report in excel from C# using the interop. I can't seem to figure out how to set the font. I have googled and found what appears to be the way, but it does not work.

I am doing:

ws_Job.Range["A1"].Style.Font.FontName = "Arial";

Which has no effect. Using Excel 2010 and the Excel 14.0 object library.

Any help much appreciated!
0
ryanbe
Asked:
ryanbe
  • 3
  • 3
1 Solution
 
NorieVBA ExpertCommented:
If you want to set the font of  a range it's just Font.Name.
ws_Job.Range["A1"].Font.Name = "Arial";

Open in new window

0
 
ryanbeAuthor Commented:
Hey! Nice.

Do you know of a good reference for the excel interop please?
0
 
ryanbeAuthor Commented:
Hi there, thanks imnorie, I have added a couple more questions please take a look.
Regards, Ryan.

http://www.experts-exchange.com/Programming/Languages/.NET/Q_27872950.html
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
NorieVBA ExpertCommented:
Ryan

I don't really know of any interop specific reference for Excel,  I normally just use the VBA reference.
0
 
ryanbeAuthor Commented:
Thanks imnorie, if you chuck that answer in my other question you might get some more points!
0
 
NorieVBA ExpertCommented:
Ryan

Maybe someone else has a better answer.

Part of the reason I can't give a recommendation is that I've never been able to find anything myself.

Even when I saw your question I did some quick searching and couldn't find anything.

On MSDN I did find something that looked promising in the C# section.

Here's the link http://msdn.microsoft.com/en-us/library/ms173184(v=vs.80).aspx.

Not much use really as far as I can see, though I could be missing something.

Anyway, let's wait and see if someone comes up with a link to a 'real' reference - I'd been interested in it too.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now