How to delete all rows from excel
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-26-2017
11:36 PM
11-26-2017
11:36 PM
How to delete all rows from excel
Hi
I have to delete all rows from excel before executing another function.
1 REPLY 1
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-26-2017
11:46 PM
11-26-2017
11:46 PM
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
Thanks
Shankar R
LinkedIn | CG-VAK Software | Bitbucket | shankarr.75@gmail.com
“You must expect great things from you, before you can do them”