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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:13:25+00:00 2026-05-23T16:13:25+00:00

After my program creates an Excel file, I let the user see that file.

  • 0

After my program creates an Excel file, I let the user see that file.

Excel.Application xlApp = new Excel.Application();
xlApp.Visible = true;
Excel.Workbook excelWorkbook = xlApp.Workbooks.Open(xlsx.saveLocation + "\\" + xlsx.fileName,
    0, false, 5, "", "", false, Excel.XlPlatform.xlWindows, "",
    true, false, 0, true, false, false);

Whenever I close the Excel window, the process (EXCEL.EXE) remains (I’m hitting the red X in the top right). Am I missing a setting or something? I want the Excel window to be independent of the C# program, so that if I end the latter the former will still be visible.

  • 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-23T16:13:26+00:00Added an answer on May 23, 2026 at 4:13 pm

    If you want true independence, then you should use Process.Start to start Excel.

    The simplest version you’d need would be:

    Process.Start(Path.Combine(xlsx.saveLocation, xlsx.fileName));
    

    though I’d recommend using the proper Path methods for combining the directory and filename into a complete path. Path.Combine

    Source

    If your path or filename has spaces then you need to wrap the whole thing in quotes:

    var arguments = new StringBuilder("\"");
    arguments.Append(Path.Combine(xlsx.saveLocation, xlsx.fileName));
    arguments.Append("\"");
    Process.Start(arguments.ToString());
    

    (Though a StringBuilder may be overkill in this scenario)

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

Sidebar

Related Questions

I have an application that seems to throw exceptions only after the program has
I have a program that writes to a FILE *cgiOut and just after it
When you install a ClickOnce application, the program runs after the install. Is it
When deploying the application to the device, the program will quit after a few
I think this is pretty simple. My program will create an Excel file on
I have a c# application that opens up a COM instance of excel and
I have my little client application which - when started - creates some user
How long will it take to enroll in the iPhone developer program after paying
Strange program hang, what does this mean in debug? After attaching windbg I found
I want to save the objects I generated in a program. After restart the

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.