1

Assume that I have a html file in which the javascript code is like this:

<script type="text/javascript">
    var test1 = 1;
    var test2 = 2;
    var tset3 = 3;
</script>

How do I get the javascript variables via Excel VBA for use in Excel VBA macros?

1 Answer 1

1
  1. You can read the html file first, use open file in VBA and save it in a string variable.
  2. Then, you should parse the string variable line by line to get any substring var xxx = yyy, use instr and loop method to get the variable name and its value.
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.