Murray Brown
asked on
ASP.net host and download an Excel 2003 spreadsheet with macros
Hi
In an ASP.net website is it possible to include an Excel 2003 spreadsheet (with VBA code) that can first be populated with data from a database (Access) table already hosted on the website and can this
spreadsheet be downloaded onto the users computer so that the VBA code can be run there.
Thanks
The code below is just an example of uploading a spreadsheet - I need the download code if possible
In an ASP.net website is it possible to include an Excel 2003 spreadsheet (with VBA code) that can first be populated with data from a database (Access) table already hosted on the website and can this
spreadsheet be downloaded onto the users computer so that the VBA code can be run there.
Thanks
The code below is just an example of uploading a spreadsheet - I need the download code if possible
Protected Sub ButtonUploadFile_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ButtonUploadFile.Click
Try
If FileUploadExcel.HasFile Then
Try
' alter path for your project
FileUploadExcel.SaveAs(Server.MapPath("~/ExcelImport.xls"))
LabelUpload.Text = "Upload File Name: " & _
FileUploadExcel.PostedFile.FileName & "<br>" & _
"Type: " & _
FileUploadExcel.PostedFile.ContentType & _
" File Size: " & _
FileUploadExcel.PostedFile.ContentLength & " kb<br>"
Catch ex As Exception
LabelUpload.Text = "Error: " & ex.Message.ToString
End Try
Else
LabelUpload.Text = "Please select a file to upload."
End If
Catch ex As Exception
MsgBox(Err.Description)
End Try
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER