Solved

Programatically set Rows to repeat for excel sheet

Posted on 2008-10-16
3
1,863 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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

747 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

8 Experts available now in Live!

Get 1:1 Help Now