Forum Discussion
- shankar_rCommunity Hero
Hi,
You can do like below,
excelObject = Sys.OleObject("Excel.Application"); excelWorkbookObj = excelObject.Workbooks.Open(<strexcelFileName>); excelMainSheet = excelWorkbookObj.Sheets.Item("<Your sheet name>"); excelMainSheet.UsedRange.ClearContents //this will only clear contents excelMainSheet.Cells.Clear //this will clear everything