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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T20:09:32+00:00 2026-05-30T20:09:32+00:00

I am attempting to export data to a excel spreadsheet and so open that

  • 0

I am attempting to export data to a excel spreadsheet and so open that Excel spreadsheet using Visual Studio 2010 and Excel 2010 on Windows 7, but I get the following error.

‘1.xls’ cannot be accessed. The file may be corrupted, located on a server that is not responding, or read-only.

I have checked the file path and given Everyone full control of the file. Here is my code.

        saveFileDialog1.FileName = "";
        saveFileDialog1.Filter = "(Excel Files)|*.xls";
        if (saveFileDialog1.ShowDialog() == DialogResult.OK)
        {
            System.IO.Stream st = new System.IO.FileStream(saveFileDialog1.FileName,
                                      FileMode.Create,
                                      FileAccess.Write,
                                      FileShare.None);
            this.gridEXExporter1.ExportMode = Janus.Windows.GridEX.ExportMode.AllRows;
            gridEXExporter1.Export(st);

      //////////////////////////////////////
      /////   Opening the Excel File
      /////////////////////////////////////
       Process.Start(saveFileDialog1.FileName);

Thanks in advance.

  • 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-30T20:09:33+00:00Added an answer on May 30, 2026 at 8:09 pm

    You probably have to close the output file before you try to open it using Excel. Call st.Close() before Process.Start.

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

Sidebar

Related Questions

Attempting to build a Visual Studio 2010 solution with 132 projects which do not
I am attempting to export mysql data into excel. I have tried the phpexcel
I'm attempting to get my first ASP.NET web page working on windows using Mono
I'm trying to export data from a web app into excel, but there is
When attempting to compile my C# project, I get the following error: 'C:\Documents and
I am trying to do a Schema Compare in Visual Studio 2010 on some
Synopsis I am attempting to export a WAR to my webapps folder but everytiime
I'm trying to create an export Excel/CSV function that will iterate through a custom
I have a WebDriver test using the FirefoxDriver that I am attempting to run
I am attempting to export a query from MS Access into MS Excel in

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.