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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T12:07:05+00:00 2026-05-19T12:07:05+00:00

I want to accomplish the following task. I have an web application through which

  • 0

I want to accomplish the following task.

  1. I have an web application through which I will be calling an VSTO apps, I have to insert some values in one of the sheets of the excel workbook

  2. I will be inserting the values in the excel sheet and will have to upload to DB using upload button.

What have I done so far.

  1. I created a web apps solution. “C:\Examples\WebVSTO\WebVSTO\WebVSTO”

  2. I created a VSTO solution. “C:\Examples\VSTO2007\VSTO2007\VSTO2007.xlsx”

  3. I insert the values in the excel sheet as below:

    System.Data.OleDb.OleDbConnection objConn = 
        new System.Data.OleDb.OleDbConnection(
        "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + 
        @"C:\Examples\VSTO2007\VSTO2007\VSTO2007.xlsx" +
        ";Extended Properties=Excel 8.0;");
    
    objConn.Open();
    
    System.Data.OleDb.OleDbCommand objCmd = new System.Data.OleDb.OleDbCommand();
    
    objCmd.Connection = objConn;
    
    objCmd.CommandText = "Insert into [Sheet1$]" + " values ('Test')";
    
    objCmd.ExecuteNonQuery();
    
    objConn.Close();
    
  4. I ran the web application, and observed that the values were inserted in the excel.

  5. I upload the values from the excel, by running the VSTO solution and the values got uploaded to the DB.

Issues

  1. The excel(only the VSTO excel and not the whole solution) will be placed in a different folder. When I hit the download button in the web apps, the excel will be downloaded in the clients place.

I face the above issue. How do I respond.

Kindly let me know.

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-19T12:07:06+00:00Added an answer on May 19, 2026 at 12:07 pm

    If I understand correctly, The question is quite a generic question: “How do I make a file not on the web application folder available for download?”

    The simple way to do it is by writing the binary code into the Response Stream and setting some headers.

    HttpResponse.Clear();
    HttpResponse.BufferOutput = false;
    HttpResponse.ContentType = "application/excel";
    HttpResponse.AddHeader("content-disposition", "filename=VSTO2007.xlsx");
    
    FileStream sourceFile = new FileStream(@"C:\Examples\VSTO2007\VSTO2007\VSTO2007.xlsx", FileMode.Open);
    long FileSize;
    FileSize = sourceFile.Length;
    byte[] getContent = new byte[(int)FileSize];
    sourceFile.Read(getContent, 0, (int)sourceFile.Length);
    sourceFile.Close();
    
    Response.BinaryWrite(getContent);
    

    I didn’t test it but it should work.

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

Sidebar

Related Questions

I want to accomplish the following scenario in Drupal: You have 2 content-types. Lets
I'm trying to accomplish the following ridiculous task: I have a text file containing
What I'm trying to accomplish My app generates some tabular data I want the
I have trouble with editing listview (asp.net 3.5 server control). I want to accomplish
I want to use the FTP task in ant, and I have found the
I need to accomplish the following. 1.) I have a winform (winformA) that is
I am working on VC++ compiler. I want to accomplish the following The variables
The following are the two tasks I want to accomplish: I want to import
I want to create a Java application bundle for Mac without using Mac. According
I want to create a client side mail creator web page. I know 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.