title: Publish an excel worksheet as an HTML file using a command button
body: <p>So I have tons of data in my workbook that I need to pass on to my users in a way that allows them to interact with the workbook..., but also limits what they can actually do. So I have made it so they can access certain pages to Add needed data, then I've given access to a menu page so they can run a report.</p>
  
  <p>This report I have found is best if it's an html page.
  To that end, I have tried several different ways, save as...and publish. I like the publish version, but I can not for the life of me get this working. All the samples I see, appear to be the same. Here is the line of code in question:</p>
  
  <pre><code>ActiveWorkbook.PublishObjects.Add(xlSourceSheet, ActiveWorkbook.Path &amp; ".htm, "Sheet1", "", xlHtmlStatic, "", "Report Title").Publish True
  </code></pre>
  
  <p>Every time I get a run time error '1004':
  Method 'Publish' of object  'PublishObject' failed </p>
  
  <p>I have the above line of code in a sub, am I missing something? Do I need to set up the publish differently? Thanks for any ideas.</p>