开发者

Get Javascript Variables Via Excel VBA

开发者 https://www.devze.com 2022-12-28 22:09 出处:网络
Assume that I have a html file in which the javascript code is like this: <script type=\"text/javascript\">

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

精彩评论

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

关注公众号