05-03-2013, 10:27 AM
Option Explicit
''**********************************************************************
'******************************************************************
after completion of this execution it has to update the "Executed" in the test data excel sheet but here I am getting the error msg as
"The remote server machine does not exist or is unavailable: 'objworkbook'
Line (53): "objExcel.objworkbook("TestData").Activate "
The remote server machine does not exist or is unavailable: 'cells'
Line (55): "objExcelSheet.cells(intcounter,3).Value = "Executed"".
Kindly look into this and do the needful
Regards,
Sreekanth
''**********************************************************************
Code:
'Script Name: DriverScript
'Author:
'Date of Design: 12-Apr-2013
'Date of last Revision: 12-Apr-2013
'Functions Called:
'Description: 'This Script performs:-
'1.Logging into the application
'2.Closing Excel spreadsheets which are open
'3.Importing the TestCase spreadsheet
'4.Executing the Test Case by calling the corresponding actions
Code:
SystemUtil.CloseProcessByName("IExplore.EXE")
SystemUtil.CloseProcessByName("EXCEL.exe")
'***** Opening and retriving data from excel file
Dim objExcel
Dim intCntrl
Dim strRun
Dim strStatus
Dim objworkbook
Dim objExcelSheet
Dim introwCount
Dim intcolCount
Dim intcounter
Set objExcel=CreateObject("Excel.Application")
Set objworkbook=objExcel.workbooks.open("D:\AutomationTesting\TestData\TestData.xls")
Set objExcelSheet=objworkbook.worksheets("Run Sheet")
introwCount=objExcelSheet.usedrange.rows.count
intcolCount=objExcelSheet.usedrange.columns.count
For intcounter=2 to introwCount-1
intCntrl=objExcelSheet.cells(intcounter,1)
strRun=objExcelSheet.cells(intcounter,2)
strStatus=objExcelSheet.cells(intcounter,3)
If strRun ="Yes" then
RunAction "Action1 ["&intCntrl&"]", oneIteration
Wait(20)
objExcel.objworkbook("TestData").Activate
objExcelSheet.cells(intcounter,3).Value = "Executed"
End If
objExcel.DisplayAlerts = False
Next
'Set objExcelSheet = Nothing
objExcel.DisplayAlerts = False
objExcel.Save
objworkbook.Save
objExcel.DisplayAlerts = True
objExcel.Quit
Set objExcel = Nothing
after completion of this execution it has to update the "Executed" in the test data excel sheet but here I am getting the error msg as
"The remote server machine does not exist or is unavailable: 'objworkbook'
Line (53): "objExcel.objworkbook("TestData").Activate "
The remote server machine does not exist or is unavailable: 'cells'
Line (55): "objExcelSheet.cells(intcounter,3).Value = "Executed"".
Kindly look into this and do the needful
Regards,
Sreekanth