Add reference to MS Excel library in Project>References
than use this code
VB Code:
Dim objExcelApp As Excel.Application,objExcelWb as Excel.Workbook Set objExcelApp=New Excel.Application 'objExcelApp.Visible=True Set objExcelWb=objExcelApp.Workbooks.Add objExcelWb.Sheets(1).Cells(1,1).Value=Now objExcelWb.SaveAs "C:\timewb.xls" objExcelWb.Close objExcelApp.Quit Set objExcelWb=Nothing Set objExcelApp=Nothing




Reply With Quote