The xl.run method only takes one parameter as input, that parameter is the
name of the macro. You cannot pass arguments to the macro this way.
www.qtptutorial.net
On Wednesday, January 8, 2014 8:30:02 AM UTC-5, Manjunath Hakari wrote:
>
> Hi,
>
> I'm running an excel macro through QTP like below:-
>
> Set xl = CreateObject("Excel.Application")
> set wb=xl.WorkBooks.Open ("path")
> Set ws=wb.Worksheets("sheet1")
> xl.Run "Macroname"
> wb.Save
> wb.Close
> xl.Quit
>
> Its working fine but when i try to pass an argument for same . Its
> throwing an error messages "Wrong number of arguments passed"
>
> xl.Run "Macroname","Arg1"
>
> I don't know how to pass arguments to macro and qtp.
>
> (Excel Macro is written in Sub Routine.)
>
> Any help would be highly appreciated.
>
> Thanks,
> Manjunath Hakari.
>
>
>
>
>
>
>
--
--
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing"
group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/MercuryQTP?hl=en
---
You received this message because you are subscribed to the Google Groups "QTP
- HP Quick Test Professional - Automated Software Testing" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.