Of course, it's possible, but you need quite a much time to write the VBA compiler
At first, you should make a html page to make sure this is what you want to see and consider, which information will change (dynamic content) and which will remain untouched (static content).
Dependently on decision, you should copy each portion of the doc into parts stored as text files somewhere onto your HDD you (or users) can access.
Then you should write corresponding VBA code, which create a new, updated HTML file, including static content from text files and dynamic content from your worksheets.
For example, you want to build a simple web page which contains text "Hello, World! This is my first web page!"
<body bgcolor="#ffffff">
<p>Hello, World! This is my first web page!</p> </body>
</html>
The text in red is placed in file HTML_HEA.txt and in green - in file HTML_FOO.txt. The black text is dynamic content of web page and is into your workbook containig 2 sheets.
So, the VBA code will look like this
Dim strHTML as string
open "C:\MyWebPage.html" for output as #1
open "C:\HTML_HEA.txt" for input as #2
do until eof(2)
line input #2, strHTML
print #1, strHTML
loop
close #2
print #1, "<p>"
for each wsh in sheets
print #1, cells(1,1).text;
next
print #1, "</p>"
open "C:\HTML_FOO.txt" for input as #2
do until eof(2)
line input #2, strHTML
print #1, strHTML
loop
close
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.