Kanwaljit Singh Dhunna
asked on
VBA Macro not working properly
Hi Experts,
Using the macro in attached Excel File, I am able to fill the data in the online web form. But strangely enough one of the filled value ("Mode of Payment") is not being accepted by the web site. But if I select a different value from the drop down and again select the Original value, then the same is being accepted.
Is there any issue with the VBA Code ? Please rectify if there is any error.
I have attached one short video of the error xzRSaszPgV.mp4
Also the excel file is attached.Challan Fill.xlsm
Using the macro in attached Excel File, I am able to fill the data in the online web form. But strangely enough one of the filled value ("Mode of Payment") is not being accepted by the web site. But if I select a different value from the drop down and again select the Original value, then the same is being accepted.
Is there any issue with the VBA Code ? Please rectify if there is any error.
I have attached one short video of the error xzRSaszPgV.mp4
Also the excel file is attached.Challan Fill.xlsm
see demo
https://jsfiddle.net/HainKurt/2vnL3zxe/
but if I manually call change event, it fires
https://jsfiddle.net/HainKurt/2vnL3zxe/
$('#NetBank_Name_c option:eq(4)').attr('selected', 'selected');
if I change selected item, change event is not triggered...but if I manually call change event, it fires
$('#NetBank_Name_c option:eq(4)').attr('selected', 'selected');
$("#NetBank_Name_c").change();
so, your problem is not VBA
but the onchange events are not triggered if you change them programmatically...
you have to call change event of those select/radio buttons...
but the onchange events are not triggered if you change them programmatically...
you have to call change event of those select/radio buttons...
ASKER
Thanks for the reply !
I can understand what you are saying, but not sure I am technically capable enough to cull out or incorporate the same in my code to derive the solution.
I can understand what you are saying, but not sure I am technically capable enough to cull out or incorporate the same in my code to derive the solution.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks a Lot Sir !
I wonder why I was facing the same issue for the last 3 years.
All I knew was that manually selecting the bank name resolved the issue, but don't know the reason and off course, not the solution. Can you elaborate the reason a bit ?
I wonder why I was facing the same issue for the last 3 years.
All I knew was that manually selecting the bank name resolved the issue, but don't know the reason and off course, not the solution. Can you elaborate the reason a bit ?
ASKER
and what that magic line did ?
there are lots of codes behind the scene
triggered when you select radio or select box, onChange events
but when you populate it programmatically, they dont run
and page thinks you never selected anything...
so, when you set X, app does not know X is selected
but when you select Y then X, that code runs...
triggered when you select radio or select box, onChange events
but when you populate it programmatically, they dont run
and page thinks you never selected anything...
so, when you set X, app does not know X is selected
but when you select Y then X, that code runs...
ASKER
I got a bit of what you said......
But my problem is solved.
Thanks a Lot Sir !
Wonderful !
But my problem is solved.
Thanks a Lot Sir !
Wonderful !
and what that magic line did ?
called the change event of select box, as if, it is selected with mouse...
ASKER
Okay ! Got it !
Thanks a Lot Sir ! That was swift and precise !
Thanks a Lot Sir ! That was swift and precise !
setBankDetails(1);