Please go through the below code. Which opens a excel file, adding a sheet with a new name and saving the file in the desired location.
Set obj_ExcelSheet = CreateObject("Excel.Application")' creating the excel object
obj_ExcelSheet.visible = True
obj_ExcelSheet.SheetsInNewWorkbook = 1 ' no of sheets to be added
obj_ExcelSheet.Workbooks.Add() ' actually adding the sheet to the file obj_ExcelSheet.Worksheets(1).Activate ' make the sheet no-1 activate
obj_ExcelSheet.Activesheet.Name = "Check" 'name of the sheet
obj_ExcelSheet.ActiveWorkbook.saveas ("C:\Documents and Settings\username\Desktop\MF.xls") 'saving the file in desired location.
obj_ExcelSheet.quit ' quiting from the excel.
Set obj_ExcelSheet = nothing
Please provide your feedback on the same.
Modi - IPL Saga is Blessing in Disguise for BCCI
15 years ago
![Reblog this post [with Zemanta]](http://img.zemanta.com/reblog_e.png?x-id=b8ccc017-f24b-41ca-b747-213b14229a2b)
No comments:
Post a Comment