Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Programatically set Rows to repeat for excel sheet

Posted on 2008-10-16
3
Medium Priority
?
2,169 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 760 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

721 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