Click here to Skip to main content
15,882,552 members
Please Sign up or sign in to vote.
4.00/5 (2 votes)
See more:
Hello,

I am using Microsoft.Office.Interop.Excel to create the Excel file.
I am able to create the Excel file but i want to download that file after create.

I used excelworkBook.SaveAs("C:\\Users\\Test\\Desktop\\testExceldata.xlsx");

In place of that i want to download the file.

Can anyone help me on this.

Regards,
Viprat
Posted

1- Add Hyper Link in your .aspx file like:
ASP.NET
<asp:hyperlink id="HyperLink1" runat="server">Download</asp:hyperlink>


2- Assign the Navigate URL to your Hyperlink in code behind When you saving your workbook.
C#
HyperLink1.NavigateUrl = "your generated file location";
 
Share this answer
 
v2
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900