Inject html into VBA generated html website.

mysticmario

Active Member
Joined
Nov 10, 2021
Messages
323
Office Version
  1. 365
Platform
  1. Windows
So i have a website which is generated by this code:
VBA Code:
Sub publish()
ThisWorkbook.Sheets("OTWARTE PROJEKTY").Activate
 ChDir ("G:\Mój dysk\ArtProInfo v1.5_Shared")
    With ThisWorkbook.PublishObjects("ArtProInfo v1.5_8106")
        .FileName = "G:\Mój dysk\ArtProInfo v1.5_Shared" & "\" & "index.html"
        .publish (False)
        .AutoRepublish = False
    End With
Application.DisplayAlerts = False

ThisWorkbook.Sheets("OTWARTE PROJEKTY").Copy
ActiveWorkbook.SaveAs FileName:="G:\Mój dysk\ArtProInfo v1.5_Shared/projekty.csv", FileFormat:=xlCSV, CreateBackup:=True
ActiveWorkbook.Close

Application.DisplayAlerts = True
ThisWorkbook.Sheets("OTWARTE PROJEKTY").Activate

End Sub
This is how it's source code looks like:
1658476316346.png
I want to inject into <head> section another meta:

<head><link rel="stylesheet" href="style.css">
<meta charset="utf-8">
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />
<meta http-equiv="refresh" content="120" >
</head>

is there a simple way to do it inside this code? Or maybe I need to insert the code somewhere on the sheet in a weird way. I have never done anything like this, I need the page to autorefresh without using plugins in the web browser, cause those often crush, or stop working after browser update.
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.

Forum statistics

Threads
1,224,828
Messages
6,181,217
Members
453,024
Latest member
Wingit77

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top