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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T13:57:31+00:00 2026-06-07T13:57:31+00:00

I have written code to open an excel file. I am interested in saving

  • 0

I have written code to open an excel file. I am interested in saving the excel file in temporary folder automatic once the user has indicated which file to open. This is for my application later on to read the excel and do whatever manipulation with it.
Here is my code below:

 private void btnbrowseFile_Click(object sender, EventArgs e)
          {
            openFileDialog1.Title = "Select an Excel file";
            openFileDialog1.InitialDirectory = @"c:\";
            openFileDialog1.Filter = "Excel 97-2007 WorkBook|*.xls|Excel WorkBook|*.xlsx|All Excel Files|*.xls;*.xlsm;*.xlsx";
            openFileDialog1.FilterIndex = 3;
            openFileDialog1.RestoreDirectory = true;

            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                txtFilename.Text = openFileDialog1.FileName;
            }

        }
  • 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-07T13:57:36+00:00Added an answer on June 7, 2026 at 1:57 pm

    You could do something like this

    if (openFileDialog1.ShowDialog() == DialogResult.OK) 
    { 
        File.Copy(openFileDialog1.FileName, Path.Combine(Path.GetTempPath(), Path.GetFileName(openFileDialog1.FileName)), true); 
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have written code that opens 16 figures at once. Currently, they all open
I have written a code in which i want to open a HTM file
Hi all i have written a small code to open a particular text file.
I have written a code to open a form if user enter value greater
I am using Excel 2007. I have C# code written in a separate binary.
I have written a code to read a file, store it in a structure
I have written some code that makes use of an open source library to
Using this I have written code to first created a zip folder and then
I have written code in Java to access web cam,and to save image... I
I have written code to perform a function that could take a while to

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.