Thread Rating:
  • 1 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to create list in excel using qtp
#1
Not Solved Question 
AM using following code snippet
Code:
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:=xlBetween, Formula1:="a,b,c"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With
But am getting error Expression expected on line 2 ie is on Add Type. But after removing ":" no error is displayed. But while execution runtime error is occuirng which says: Syntax error.
Will appreciate the response on this.
Thanks.
Reply
#2
Not Solved
Any help will be appreciated. Thanks
Reply
#3
Not Solved
Hi charan,

As per my understand,

I understood that you are looking for filter option in excel (List as per you terminology).

Code:
set objExcel=Createobject("Excel.Application")
set objWorkbook=objExcel.Workbooks.open("D:\venkat.xls")
set objworksheet=objExcel.worksheets("sheet1")
objworksheet.cells(1,1).autofilter
objworksheet.cells(1,1).autofilter 1,"99"   'It will filter the values w.r.t 99
objworksheet.cells(1,1).autofilter 2,"batchu"
objworksheet.cells(1,1).autofilter 1,"2"
set objExcel=Nothing
set objWorkbook=Nothing
set objworksheet=Nothing


Regards,
Venkat.Batchu
Reply
#4
Not Solved
Hi Venkat,
Thanks for your reply. But I am not looking for autofilter. Actually I am looking for combobox(listbox) creation through QTP VB code in Excel sheet. I am capturing data through front end screen from combobox and I want to save same comboox data in a cell in Excel sheet through VB coding. Any help in this regard is appreciable.
Thanks.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Trying to create List box in excel sheet at Run time with values yes No JACKSPARROW 0 1,736 01-17-2017, 11:05 AM
Last Post: JACKSPARROW
  Compare second web list value according to the first web list value roselin6 1 2,888 10-07-2015, 09:14 PM
Last Post: supputuri
  QTP: WebEdit : How to check if values in list are disabled. katdean 4 8,624 07-27-2011, 08:52 AM
Last Post: rajpes
  What is the difference between Description.Create() and Description.Create? njnirmal 1 6,476 07-31-2009, 05:24 PM
Last Post: Saket
  How to create testcases with VB script in QTP martin 1 3,153 12-02-2008, 10:07 PM
Last Post: roxer

Forum Jump:


Users browsing this thread: 1 Guest(s)