Function written in Func library is not returning values but works in same script - 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: Function written in Func library is not returning values but works in same script (/Thread-Function-written-in-Func-library-is-not-returning-values-but-works-in-same-script) |
Function written in Func library is not returning values but works in same script - Shwethareddy - 02-21-2013 Hi, Below function when put in a function library is not returning values, while the same copied to same script works. Note:Script is associated with the library & other sub procedures in the same library called by the same script are working fine. Below is the code in the script: Code: Set myxl=nothing RE: Function written in Func library is not returning values but works in same script - Shwethareddy - 02-22-2013 ------------------------------------------------------------ Hi Selvam, Thanks for the reply! Below code isn't working still and throwing following errors- Scenario1: 1.Access Denied: objhttp.send 2.Object required: 'mysheet' Function file: C:\CCAMSauto\Links.qfl Line (12): " mysheet.cells(roc+1,1)=nam". Scenario2: When i copy the same function in script & use 'On Error resume next in the function' data is written to excel sheet.But when i dont use exception handling it throws above errors. Scenario3: When i use exception handing in the function and have teh function in func library, script runs but data is not written to excel sheet. RE: Function written in Func library is not returning values but works in same script - basanth27 - 02-22-2013 Shwetha, Remove the on error resume next and put the code on debug mode. Trace the flow and you will know the issue. RE: Function written in Func library is not returning values but works in same script - ssvali - 02-22-2013 Shwetha, U need pass 3 more parameters in Geturlstatus function Call Geturlstatus(url,mysheet,nam,a). In the function change roc+1 to a+2. I tried by changing this and it is working fine Try and let us know the result. RE: Function written in Func library is not returning values but works in same script - Shwethareddy - 02-22-2013 Thanks for the info,Function is being called and data is written to Excel. But getting an exception for objhttp.send as "Access Denied". Captured the error number(21479XXX), but was unable to analyse on the exception. Please let me know if this is something to do with configurations. Note:This is happening on any web page on my machine. RE: Function written in Func library is not returning values but works in same script - vinod123 - 02-25-2013 There is no access for u for the url |