Micro Focus QTP (UFT) Forums
How to access the excel userform using QTP - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: How to access the excel userform using QTP (/Thread-How-to-access-the-excel-userform-using-QTP)



How to access the excel userform using QTP - nigamreetesh84 - 02-11-2013

Hi All,

I want to access the userform and Macros of excel using QTP.

I tried to find the object using QTP properties but It could not work for me.
Below are the code which I have tried:


I have added the below code in the excel and vbs script but getting the error that GetForm is not a valid property

Code:
Public Property Get GetForm() As Object
   Set GetForm = New UserForm1
End Property

dim objExcel, wbkExcel, frm
set objExcel = Createobject("Excel.Application")
objexcel.visible = true
set wbkExcel = objExcel.workbooks.open("C:\formtest.xls")
set frm = wbkexcel.GetForm
frm.show