Runtime error 1004 - HELP! RRS feed

  • Question

  • Hi,

    I have an Excel-sheet with a pricelist that I want to update, but everytime I do so, I get the error: Run-time error 1004: Application-defined or object-defined error."

    When I try to debug the code this is highlighted:

    With ActiveWorkbook.PublishObjects.Add(xlSourceRange, _
            ActiveWorkbook.Path & url & destination, _
            srcSheet, srcSheet & "!" & srcRange, xlHtmlStatic, "", "")

    I've tried searching everywhere for a solution to my problem, but with no luck. I am new to VBA and would appreciate some guidance or any suggestions for a solution.



    Friday, May 23, 2014 10:16 AM

All replies

  • Have you made sure you have added the appropriate references for Excel?

    Happy to help ! When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answered

    Friday, May 23, 2014 10:53 AM
  • Thank you for the quick response!

    I have one sheet in my worksheet, with a table of contents and all I've done was to change the order of two subjects. Would I need to change something in the references as well? If so - how do I do this?



    Friday, May 23, 2014 11:35 AM
  • In teh immediate window type:

    ?srcSheet & "!" & srcRange

    press Enter and let us know what the result is. You may need

    srcSheet & "!" & srcRange.Address

    Rod Gill
    Author of the one and only Project VBA Book

    Saturday, May 24, 2014 4:46 AM