Dim oExcel, oWB, oSheet, getVal
Set oExcel=CreateObject(“Excel.Application”)
Set oWB=oExcel.Workbooks.Open(“C:abhikansh.xls”)
Set oSheet=oWB.WorkSheets(“Sheet1”)
oExcel.Visible=TRUE
getVal=oSheet.Cells(1,1).Value
print getVal
oWB.Close
Set oExcel=Nothing
‘Inserting value to an existing excel sheet
Dim oExcel, oWB, oSheet, setVal
Set oExcel=CreateObject(“Excel.Application”)
Set oWB=oExcel.Workbooks.Open(“C:abhikansh.xls”)
Set oSheet=oWB.WorkSheets(“Sheet1”)
oExcel.Visible=TRUE
setVal=”ValueInserted”
oSheet.Cells(4,1).Value=setVal
oWB.Save
oWB.Close
Set oExcel=Nothing
‘Create a new excel sheet, insert values and save it..
Dim oExcel, oWB, oSheet, setVal
Set oExcel=CreateObject(“Excel.Application”)
Set oWB=oExcel.Workbooks.Add
Set oSheet=oWB.WorkSheets(“Sheet1”)
oExcel.Visible=TRUE
setVal=”ValueInserted”
oSheet.Cells(4,1).Value=setVal
oWB.SaveAs(“C:abhikansh1.xls”)
oWB.Close
Set oExcel=Nothing
Nice example. I am having trouble closing an Excel file which opens from web application. Could anyone please tell me how can I close that file. The recorded script doesn't work.
Rosh.
Hi Abhikansh, nice code working, my scenario is to save web table contents suppose the web table has 100 rows and 10 columns, Can u please let me know the code How to save those values into an external excel sheet.
Hi Abhikansh, how do you actually work with an existen (already open) Excel sheet
Thank you