Solved

Programatically set Rows to repeat for excel sheet

Posted on 2008-10-16
3
2,107 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 70

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

More Than Just A Video Library

Train for your certification. Learn the latest DevOps tools. Grow your skillset to do better work.

At Linux Academy, we release new training modules every week so you'll always be up to date on the latest tech.

Question has a verified solution.

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

When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

617 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