+ Reply to Thread
Results 1 to 8 of 8

Problem with ActiveWorkbook.PublishObjects.Add - html file being generated without code

  1. #1
    Registered User
    Join Date
    12-17-2012
    Location
    Lebanon, NH, USA
    MS-Off Ver
    Excel 2010
    Posts
    10

    Problem with ActiveWorkbook.PublishObjects.Add - html file being generated without code

    Hi,

    I have been using this forum for a lot of my issues and the solutions suggested here have almost always solved my problems. But there is this one issue I am facing and can't seem to find the answer here. So here goes:

    I am using the following code to covert a variable range to an html.

    Please Login or Register  to view this content.
    This code works fine and it gives me the right range of values I want. I then figured that I don't have to convert to an html so I deleted this piece of code. Now, the problem I am facing is that even after deleting this piece of code, an html file is being generated at the location above. I don't want the html. I am sure there is a small fix to this somewhere but I am clueless as to why this is happening even after deleting the code.

    Any pointers?
    Last edited by Leith Ross; 12-24-2012 at 08:53 PM. Reason: Added Code Tags

  2. #2
    Registered User
    Join Date
    12-17-2012
    Location
    Lebanon, NH, USA
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Problem with ActiveWorkbook.PublishObjects.Add - html file being generated without cod

    Really appreciate some help on this.

  3. #3
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643
    I can't see how an HTML file could be generated if you've deleted the code that does that.

    Is this all the code?

    Have you tried stepping through whatever code you have with F8?
    If posting code please use code tags, see here.

  4. #4
    Forum Expert OllieB's Avatar
    Join Date
    12-20-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2007 (home) & 2010 (office)
    Posts
    1,542

    Re: Problem with ActiveWorkbook.PublishObjects.Add - html file being generated without cod

    Please check the following page for the solution

    http://office.microsoft.com/en-us/ex..._autorepublish

    especially the bit about AutoRepublish
    If you like my contribution click the star icon!

  5. #5
    Registered User
    Join Date
    12-17-2012
    Location
    Lebanon, NH, USA
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Problem with ActiveWorkbook.PublishObjects.Add - html file being generated without cod

    Hi Norie,

    Thanks for replying. I did step into the code. But there are no errors to look for. My code works fine. Just that, the html is still getting generated even when there is "no code". In a lame attempt I changed the location of the file and also renamed it but that did no good. Everytime I run my macro, I still have the html generated in the same folder as the excel file.

    I am totally clueless as to why this is happening. I have about 20 macros in this file, about 10 custom functions and 15 tabs. If nothing works, I will attempt to copy paste the entire code and all the tabs to a new workbook and save it with a different file name and see what happens but I am really not looking forward to doing this.

  6. #6
    Forum Expert OllieB's Avatar
    Join Date
    12-20-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2007 (home) & 2010 (office)
    Posts
    1,542

    Re: Problem with ActiveWorkbook.PublishObjects.Add - html file being generated without cod

    The code you ran earlier has just activated the publish feature for the workbook/worksheet and the AutoRepublish will ensure that the html keeps on being published. The code is no longer needed for that. See the link to the web page provided.

  7. #7
    Registered User
    Join Date
    12-17-2012
    Location
    Lebanon, NH, USA
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Problem with ActiveWorkbook.PublishObjects.Add - html file being generated without cod

    I just followed the steps in the link you sent. It worked. Thank you so much Olaf. I knew there was a simple fix to this. I just didn't know what was causing the problem. Now I know.

    Thanks again.

  8. #8
    Forum Expert OllieB's Avatar
    Join Date
    12-20-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2007 (home) & 2010 (office)
    Posts
    1,542

    Re: Problem with ActiveWorkbook.PublishObjects.Add - html file being generated without cod

    You are very welcome!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1