your excel file path Dim path As String = Server.MapPath("~/Uploads/" & fileUpload.FileName) Dim objexcel As New Excel.Application Dim o_nullobject As Object = System.Reflection.Missing.Value Dim o_filePath As Object = path Dim doc As Excel.Workbook = objexcel.Workbooks.Open(o_filePath, o_nullobject, o_nullobject, o_nullobject, o_nullobject, o_nullobject, o_nullobject, o_nullobject, o_nullobject, o_nullobject, o_nullobject, o_nullobject, o_nullobject, o_nullobject, o_nullobject) Dim o_newfilename As Object = Server.MapPath("~/Uploads/") & _ fileUpload.FileName.Replace(".xls", ".html") Dim o_format As Object = Excel.XlFileFormat.xlHtml Dim o_encoding As Object = Microsoft.Office.Core.MsoEncoding.msoEncodingUTF8 'Dim o_endings As Object = Excel.xll.WdLineEndingType.wdCRLF objexcel.ActiveWorkbook.SaveAs(o_newfilename, o_format, o_nullobject, o_nullobject, o_nullobject, o_nullobject, Excel.XlSaveAsAccessMode.xlNoChange, o_nullobject, o_nullobject, o_nullobject, o_nullobject, o_nullobject) lblMessage.Text = "Uploaded successfully!" doc.Close(o_nullobject, o_nullobject, o_nullobject)
|
No responses found. Be the first to respond and make money from revenue sharing program.
|