1.装完VB6之后,打开VB6应用程序,打开之后,选择ActiveX DLL,点击打开。
2.进入之后在脚本编辑的地方写FUNCTION函数
3.修改右边的工程名和类名分别为: EOM 和 WriteCellsValue
4.点击左上角菜单栏的文件-->>生成DLL
5.注册DLL文件,regsvr32 C:\Users\dingfeiwu\Desktop\QTP\EOM.dll
6、注册为QTP的Utility Objects,运行下面的reg文件。
Windows Registry Editor Version 5.00 [HKEY_CURRENT_USER\Software\Mercury Interactive\QuickTest Professional\MicTest\ReservedObjects\EOM] "ProgID"="EOM.WriteCellsValue" "UIName"="EOM" "VisibleMode"=dword:00000002
7、注册成功后,重新启动QTP,可以在QTP中直接调用该函数
如:EOM.WriteCellsValue "D:\function\EnvironmentConfiguration.xls", "Sheet2", 2,2,"pass"
注册成功,可以在QTP的Step Objects里面查看到。