• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Calling VBA macro from javascript in webbrowser control and passing a string variable to it

Tom A

Member
Hi,

I am using the webbrowser control in a form. I would like to pass a javascript string to a VBA variable when I click on a button in the html file. Is there any way to do this?
I found the below code but it doesn't work. It also doesnt pass a javascript string to a VBA procedure:

Code:
//We could directly call a macro from JavaScript, please refer to following script: 
<SCRIPT>
function CallVBA(MacroName)
{
var ExApp;
ExApp = new ActiveXObject("Excel.Application");
ExApp.Run(MacroName);
}

CallVBA("HelloExcel");
</SCRIPT>

thanks,
Tom
 
Back
Top