开发者

Get Javascript Variables Via Excel VBA

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 = 开发者_如何学JAVA3;
</script>

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


  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.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜