Forum Discussion

krkarthik_info's avatar
krkarthik_info
Frequent Contributor
12 years ago

Converting .xls file into .html file format

Hi,



Can anyone tell me how to convert an .xls file into .html file using testcomplete script? Please let me know is there any inbuilt function available to do this conversion?

2 Replies


  • Hi,


     


    The following sample shows how to save an Excel file to the HTM format:


     




    'VBScript


    Function SaveExcelToHtml


      Const xlHTML = 44 


      Set objExcel = CreateObject("Excel.Application")


      objExcel.Visible = True


      


      Set objWorkbook = objExcel.Workbooks.Open("<Excel_File>")


      Set objWorksheet = objWorkbook.Worksheets("Sheet1")


     


      objExcel.DisplayAlerts = False


     


      objWorkbook.SaveAs "<HTML_File>", xlHTML


    End Function