Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3975122
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T04:38:51+00:00 2026-05-20T04:38:51+00:00

I have automation to create an Excel document from C#. I am trying to

  • 0

I have automation to create an Excel document from C#. I am trying to freeze the top row of my worksheet and apply filter. This is the same as in Excel 2010 if you select View > Freeze Panes > Freeze top row, and then after selecting top row Data > Filter. I do not have any idea how to apply the filter but the following is what I tried for freezing the top row and it just froze the entire worksheet. Does anyone have a solution to my problem. The data filter problem is where I need more help so if anyone has a solution to that please enlighten me.

Many thanks,
KBP

        workSheet.Activate();
        Excel.Range firstRow = (Excel.Range)workSheet.Rows[1];
        firstRow.Activate();
        firstRow.Select();
        firstRow.Application.ActiveWindow.FreezePanes = true;
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T04:38:52+00:00Added an answer on May 20, 2026 at 4:38 am

    I figured it out!

    @Jaime’s solution to freezing the top row worked perfectly. And the following is my solution to applying the filter:

    Thanks,
    KBP

    // Fix first row
    workSheet.Activate();
    workSheet.Application.ActiveWindow.SplitRow = 1;
    workSheet.Application.ActiveWindow.FreezePanes = true;
    // Now apply autofilter
    Excel.Range firstRow = (Excel.Range)workSheet.Rows[1];
    firstRow.AutoFilter(1, 
                        Type.Missing, 
                        Excel.XlAutoFilterOperator.xlAnd, 
                        Type.Missing, 
                        true);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this piece of code for reading from an excel cell: public T
I’m trying to create a COM User Defined Function automation add in for Excel
VSTO 4.0 / Office 2007 In an Excel document-level automation project, I have a
I am trying to create an automation to perform some action to a HTML
I am trying to using Word Automation to save a document to a network
I have created an Automation Add-in for Excel,implemented as a C# class library, which
LANGUAGE: C#, System: Windows7, Excel 2007 I want to create a .DBF from some
We have a program made in Borland Delphi that uses Word automation to create
I have created an Automation Add-in for Excel,implemented as a c# class library, which
I have an automation system and I would like to record user logins and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.