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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T15:32:19+00:00 2026-05-14T15:32:19+00:00

I am developing an application to read an excel spreadsheet, validate the data and

  • 0

I am developing an application to read an excel spreadsheet, validate the data and then map it to a sql table. The process is to read the file via a streamreader, validate the data, manually make corrections to the excel spreadsheet, validate again — repeat this process until all data validates.

If the excel spreadsheet is open, then when I attempt to read the data via a streamreader I get an error, “The process cannot access the file … because it is being used by another process.” Is there a way to remove the lock or otherwise read the data into a streamreader without having to open and close excel each time?

  • 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-14T15:32:20+00:00Added an answer on May 14, 2026 at 3:32 pm

    When you call File.Open to get the stream are you using the overload that allows you to specify FileAccess?

    http://msdn.microsoft.com/en-us/library/y973b725.aspx

    Note the parameters:

    public static FileStream Open(
        string path,
        FileMode mode,
        FileAccess access,
        FileShare share
    )
    

    You can pass FileAccess.Read to the third param to indicate you only need read-only access. You should also set FileShare.Read to allow others to open the file read-only instead of locking it yourself. Note that if MS Excel opens the file with FileShare.None, you probably wont be able to access it.

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

Sidebar

Ask A Question

Stats

  • Questions 514k
  • Answers 514k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Most of it doesn't make sense. Specifier and qualifier are… May 16, 2026 at 6:05 pm
  • Editorial Team
    Editorial Team added an answer As Tomaka17 says, you don't really have to worry about… May 16, 2026 at 6:05 pm
  • Editorial Team
    Editorial Team added an answer It ended up being an issue with the readHeader() function.… May 16, 2026 at 6:05 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I am developing application that works with sql server, I read and update data
I'm developing application that will read messages from IMAP server.. what would you recommend
i'm developing application that is listening to the data coming to the pc and
I'm developing an application to identify incoming messages (SMS) and makes a file (on
We're developing a cross-platform network application that needs to send and receive data over
I am working on SQL Server 2000. As you know, there is an application
I am new to iPhone development, I am developing an application like sync for
I am developing an application in C# (.NET), and am having trouble dealing with
I'm currently developing application using DirectSound for communication on an intranet. I've had working
I'm a first time iPhone application developer and I'm developing application for my client

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.