[英]Download Excel File ASP VB.Net
My goal is to download the excel that I've created 我的目标是下载我创建的Excel
The code so far and works properly : 到目前为止的代码,可以正常工作:
Dim xlApp As Excel.Application
Dim xlWorkBook As Excel.Workbook
Dim xlWorkSheet As Excel.Worksheet
Dim misValue As Object = System.Reflection.Missing.Value
xlApp = New Excel.ApplicationClass
xlWorkBook = xlApp.Workbooks.Add(misValue)
xlWorkSheet = CType(xlWorkBook.Sheets("sheet1"), Excel.Worksheet)
xlWorkSheet.Cells(1, 1) = "RECORD_STATUS"
xlWorkSheet.Cells(1, 2) = "VENDOR_NO"
xlWorkSheet.Cells(1, 3) = "PARTS_NO"
xlWorkSheet.Cells(1, 4) = "EFECTIVE_DATE"
xlWorkSheet.Cells(1, 5) = "CURRENCY_CODE"
xlWorkSheet.Cells(1, 6) = "PRICE"
xlWorkSheet.Cells(2, 1) = "A"
xlWorkSheet.Cells(2, 2) = "NSEA"
xlWorkSheet.Cells(2, 3) = "13231JX02A"
xlWorkSheet.Cells(2, 4) = "2013/03/03"
xlWorkSheet.Cells(2, 5) = "IDR"
xlWorkSheet.Cells(2, 6) = "10"
xlWorkSheet.SaveAs("D:\TemplateVendor.xlsx")
xlWorkBook.Close()
xlApp.Quit()
releaseObject(xlApp)
releaseObject(xlWorkBook)
releaseObject(xlWorkSheet)
This save in drive D, how could I save in the Desktop path and auto download the file, thanks 这保存在驱动器D中,我如何保存在桌面路径中并自动下载文件,谢谢
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.