Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Run time error - Excel object
#6
Solved: 11 Years, 3 Months, 3 Weeks ago
Hi Sasi
please check my code, i tried to simulate your error.
1. Function definition:
Code:
Public Function ReadExcel()
Set appExcel = CreateObject("Excel.Application")
Set objWorkBook = appExcel.Workbooks.Open ("C:\Documents and Settings\Administrator\Desktop\ActualizedTrades_06Mar10.xls")     'opens the sheet
Set objSheet = appExcel.Sheets("ACTUALIZED_TRADE")             ' To select particular sheet
Column_Count=objSheet.usedrange.columns.count
Row_Count=objSheet.usedrange.rows.count
Environment.value("data1")=objSheet.cells(1.1).value
End Function

2. Associate .vbs file in settings >> resources

3. Main script in QTP:
Code:
Call ReadExcel()
MsgBox Environment.Value("data1")
' This line will print the cell data

This is working fine for me. can you please check, is it the way you are trying to do? OR am i understanding it other way?
Reply


Messages In This Thread
Run time error - Excel object - by sasi1982 - 11-03-2010, 02:45 PM
RE: Run time error - Excel object - by sasi1982 - 11-03-2010, 03:29 PM
RE: Run time error - Excel object - by A.Saini - 11-03-2010, 04:00 PM
RE: Run time error - Excel object - by sasi1982 - 11-03-2010, 04:28 PM
RE: Run time error - Excel object - by KavitaPriyaCR - 11-03-2010, 04:36 PM
RE: Run time error - Excel object - by sasi1982 - 11-03-2010, 05:06 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  General run error when Exist fails msacks 1 1,851 02-08-2019, 02:12 AM
Last Post: Ankur
  Trying to create List box in excel sheet at Run time with values yes No JACKSPARROW 0 1,707 01-17-2017, 11:05 AM
Last Post: JACKSPARROW
  General Object Error(Find Object Error) akhandesh 1 3,600 02-24-2016, 01:05 PM
Last Post: sindhus
Rolleyes The test run cannot continue due to an unrecoverable error neerndg123 3 8,653 09-17-2015, 08:27 PM
Last Post: ananthakumarbe
  HI, i'm having a run time error ,please help? Awzar 0 2,634 01-24-2015, 06:52 AM
Last Post: Awzar

Forum Jump:


Users browsing this thread: 1 Guest(s)