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.
|