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 8020953
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T21:50:04+00:00 2026-06-04T21:50:04+00:00

I am using Microsoft Interop to convert excel files into csv files. I use

  • 0

I am using Microsoft Interop to convert excel files into csv files. I use sheet.SaveAs function.

My initial excel sheet has data from A1 to AZ columns for 100 rows.
I need in the CSV just the data from A1 to AP and only for 50 rows.

Using the Range function, I delete the row51-100, I clear the contents for the same rows, still when I save as CSV, I find rows 51-100 as below: (just commas). I do not want to see these commas in CSV.

,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,,

The same for column AQ-AZ as well. I do not want these data in CSV. I delete, clear contents using Range function, yet these AQ-AZ columns appears in CSV files as “,,,,,,,,,,,,,,,,,,,,,” .

Is there a way to save XLS as CSV with only Range that I want to see in the CSV file. Is there a way to control the range that goes into CSV file?

In short, I want to see in CSV file just the data for column A1 to AP for 50 rows. No empty trailing “,”s. Is there a way?

  • 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-04T21:50:06+00:00Added an answer on June 4, 2026 at 9:50 pm

    The issue you are describing seems like a “Last Cell” issue. The last cell is the original end of your data, even after you delete rows/columns.

    Here is what Microsoft has to say about it: How to reset the last cell in Excel

    I seem to remember a programmatic way of doing this, but for the life of me, I cannot recall how.

    Having looked at that info, maybe you could rethink how you can do this.

    Perhaps you could just read the data you need and write it out yourself.

    i.e. For each row in range, get the row as a value which will be an array of object,
    convert to array of string, string.join with the delimiter as a comma and append
    to a .csv file.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using Microsoft Interop to read the data. In excel-sheet the column-names are
I am reading Excel worksheet data using C# and Microsoft.Office.Interop. The sheet contains some
I am using Microsoft Interop to read the data. In excel-sheet, multiple random columns
i have a web service that reads data from excel using Microsoft.Office.Interop.Excel. It works
I am using Microsoft Office Interop to open Excel files. The file is placed
I'm using Microsoft.Office.Interop.Excel to create Excel file in C#, append data, change format and
Hi all am creating a excel using Microsoft office interop.and it creates files successfully.But
I am creating an Excel Worksheet from C# using Microsoft.Office.Interop.Excel, and I have not
I am writing a program that generates excel reports, currently using the Microsoft.Interop.Excel reference.
I am using Microsoft.Office.Interop.Excel.Application oExcelApp = (Microsoft.Office.Interop.Excel.Application)Marshal.GetActiveObject(Excel.Application); in my project. It gives me an

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.