hi rahul1234,
The 'SheetID' argument for DataTable.Value is optional and the values could be the sheetname, index or dtLocalSheet or dtGlobalSheet.
If you do not specify a value for this, the first sheet in the datatable is used i.e global sheet.
This will work for any value you specify like MySheet, dtdemoSheet etc. I think QTP treats this as a variable and it gets it as empty as not declared anywhere and uses the first sheet. this is why your script is working.
Use Option Explicit.
The 'SheetID' argument for DataTable.Value is optional and the values could be the sheetname, index or dtLocalSheet or dtGlobalSheet.
If you do not specify a value for this, the first sheet in the datatable is used i.e global sheet.
This will work for any value you specify like MySheet, dtdemoSheet etc. I think QTP treats this as a variable and it gets it as empty as not declared anywhere and uses the first sheet. this is why your script is working.
Use Option Explicit.