title: How to automatically publish a HTML Chart in Excel using a VBA Macro?
body: <p>I am trying to publish an Excel Chart automatically every minute using a VBA code. </p>
  
  <pre><code>Sub Auto_Open()
  ActiveWorkbook.PublishObjects.Add(xlSourceChart, _
   "C:\Users\file\graph.html" _
   , "Chart1", "", xlHtmlStatic, "DevXSample_16365", _
   "Graph1").Publish (True)
  Application.OnTime Now + TimeValue("00:01:00"), _
   "Auto_Open"
  End Sub
  </code></pre>
  
  <p>I've grab this code in a website but when I run it Excel displays this error message: "Application-defined or object-defined error".
  Does anybody know what is happening?</p>