Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 504
  • 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
 
NorieData ProcessorCommented:
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
Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

 
NorieData ProcessorCommented:
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
 
NorieData ProcessorCommented:
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

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

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