Solved

Programatically set Rows to repeat for excel sheet

Posted on 2008-10-16
3
1,904 Views
Last Modified: 2013-12-17
Hi Experts,

I am trying to progrmatically set an excel file through C# to print the header row on each page.
I am setting various properties, but can't seem to find one that will do this.

In excel it can be set by going to File - Page Setup - Sheet tab - Rows to repeat at top: 1:1

How can this be done through C#.

Thanks in advance.
0
Comment
Question by:ksedran
3 Comments
 
LVL 81

Accepted Solution

by:
zorvek (Kevin Jones) earned 190 total points
ID: 22738322
I can't provide the exact C# syntax, but the property you want is:

   oSheet.PageSetup.PrintTitleRows = "$1:$1"

Kevin
0
 
LVL 69

Expert Comment

by:Éric Moreau
ID: 22739701
record a macro in Excel. it provides almost the exact required code.
0
 

Author Comment

by:ksedran
ID: 22741307
Thanks zorvek.

That did it.
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Improved? Move/Copy Add-in Replacement - How to avoid the annoying, “A formula or sheet you want to move or copy contains the name XXX, which already exists on the destination worksheet.” David Miller (dlmille)  It was one of those days… I wa…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now