View Single Post
  #1 (permalink)  
Old November 17th, 2006, 10:15 AM
lmariocd lmariocd is offline
Registered User
 
Join Date: Nov 2006
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default PublishObject Publish method is failing

Hello,

I am new to Excel VBA and I'm sure that this post will be addressed fairly quickly. Thanks in advance for your help.

I am trying to publish an Excel chart from an open workbook to a file, but an error is generated on this line:

ActiveWorkbook.PublishObjects.Publish(True)

The compiler complains about the "Publish" method. The error message is: "Wrong number of arguments or invalid property assignment."

Here is the code:


Sub SaveChartWeb()
    ActiveWorkbook.PublishObjects.Add _
        SourceType:=xlSourceChart, _
        Filename:="D:\My Documents\QADevelopment\charts\test.htm", _
        Sheet:="Test Status", _
        Source:="Chart 1", _
        HtmlType:=xlHtmlChart, _
        DivID:="test", _
        Title:="test"

ActiveWorkbook.PublishObjects.Publish (True)
End Sub

Any help will be greatly appreciated.


Reply With Quote