mableu

We can format a range as table by click the "Format as Table" button in Ribbon of Excel 2007. I wanna implement the same style in C# code. How to do

Re: Visual Studio Tools for Office How can I format a range as table using C#?

Cindy Meister

Questions concerning automation of an Office application are technically off-topic in this forum, which is dedicated to questions concerning the VSTO technology. A list of appropriate newsgroups is provided in the "Please Read First" posting at the top of the forum.

The macro recorder is your friend, even in Excel 2007. Recording a macro when using this button reveals the basic syntax. If you require assistance "translating" this into C#, ask in the office.developer.automation newsgroup.

ActiveSheet.ListObjects.Add(xlSrcRange, Range("$A$1:$C$4"), , xlYes).Name = _
"Table1"
Range("Table1[#All]").Select
ActiveSheet.ListObjects("Table1").TableStyle = "TableStyleLight10"






Re: Visual Studio Tools for Office How can I format a range as table using C#?

mableu

Thank you for your generous help!