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

  • Home
  • SEARCH
  • 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 7787753
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T20:46:13+00:00 2026-06-01T20:46:13+00:00

I use C# & Excel Intropt.dll for my project I want Open my xlsx

  • 0

I use C# & Excel Intropt.dll for my project

I want Open my xlsx file and adding a value (For Example “1”) to All Of my cells in Sheet1.

How can i achieve this?

Like this:

12   14    19    22

81   91    26    62

Result:

13   15    20    23

82   92    27    63
  • 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-06-01T20:46:15+00:00Added an answer on June 1, 2026 at 8:46 pm

    You can use this snippet. Cells[1,1] is the first cell at the top left corner. This gets the first sheet, but you can also reference them by name.

    Excel.Application xlApp;
    Excel.Workbook xlWorkBook;
    Excel.Worksheet xlWorkSheet;
    object misValue = System.Reflection.Missing.Value;
    
    xlApp = new Excel.ApplicationClass();
    xlWorkBook = xlApp.Workbooks.Open(_filename, 0, true, 5, "", "", true, Excel.XlPlatform.xlWindows, "\t", false, false, 0, true, 1, 0);
    xlWorkSheet = (Excel.Worksheet)xlWorkBook.Worksheets.get_Item(1);
    
    //You can loop through all cells and use i and j to get the cells
    xlWorkSheet.Cells[1,1].Value2 = Convert.ToInt32(xlWorkSheet.Cells[1,1].Value2) + 1;
    
    xlWorkBook.Close(false, misValue, misValue);
    xlApp.Quit();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to use css3 & google web fonts for the navigation (instead of
I use a simple FileUpload control to select a excel file, retrieve the data
I am use aspose excel export. I am setting formulla in .net. I want
I have just starting to use excel (to do something other than just open
I'm trying to use ADODB in VBScript to access an Excel file to find
I have data that I want to have written into a Microsoft Excel File.
I need an excel formula that calculates the SUM of all column cells from
We use the CellFormatting event to colour code cells in various grids all over
In Oracle you can use &&VAR_NAME in a script and then the script will
I find SharePoint (WSS 3) portal messy to use & manage with TFS. I

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.