Asked by duncanb7
at 2024-10-28 01:31:22
Point:500 Replies:11 POST_ID:828398USER_ID:11059
Topic:
Visual Basic Programming;Hypertext Markup Language (HTML);JavaScript
I would like to finish a task with the following produreces in VBA Excel
1- Open example.html file in vba
2- Search the location of a text ,"<script text/Javascript>" in example.html by VBA
3- Insert other text such as follows and insert it right below the seach location
var g_iSh = 0;
if (window.location.search)
g_iSh = window.location.search.split(/=/)[1];
window.setInterval("refreshPage()", 10000); //refresh every 10 sec
4- save the file with insertion in html format by VBA
5- Done
I've just done the part of the search whether the text is existed or not in the htm file
but the function could "not" find out the l exact line numbe or location of the text for
preparing text insertion. ICould you provide me some function related that part and related to the my task producedure descibed above ? Please advise ?
Duncan
1- Open example.html file in vba
2- Search the location of a text ,"<script text/Javascript>" in example.html by VBA
3- Insert other text such as follows and insert it right below the seach location
var g_iSh = 0;
if (window.location.search)
g_iSh = window.location.search.split(/=/)[1];
window.setInterval("refreshPage()", 10000); //refresh every 10 sec
4- save the file with insertion in html format by VBA
5- Done
I've just done the part of the search whether the text is existed or not in the htm file
but the function could "not" find out the l exact line numbe or location of the text for
preparing text insertion. ICould you provide me some function related that part and related to the my task producedure descibed above ? Please advise ?
Duncan