'Open existing excel file
Set obj=Createobject("Excel.
Set objwb=obj.WorkBooks.Open("D:\
Set objsheet=objwb.Sheets("Sheet1"
obj.visible="True"
'Delete Row from sheet
objsheet.Rows(4).Delete
'Delete Columns from sheet
objsheet.Columns(1).Delete
'Enter data into excel sheetobjsheet.cells(5,5)="Welcome"
'Change Font Color
objsheet.Cells(5,5).Font.Color = vbRed
'Get data from excelsheet by mentioning row and col
msgbox objsheet.cells(5,1)
'Change name of excel sheet
objsheet.Name ="NewSheet"
'Count # of sheet
sheetCount = objwb.Sheets.Count
'Add New Sheet
objwb.Sheets.Add
'Delete existing sheet
objsheet.Delete
RemoveWorksheet = "SheetNew"
'Find/Search data in excel Sheet If search_item found within excel sheet , flag will hold the row # (found)
search_item="North"
set foundrow=objsheet.Cells.Find(
On Error resume next
flag=foundrow.Row
msgbox flag
objwb.Save
objwb.Close
No comments:
Post a Comment