p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: VBScript Programmer's Reference, 1st, 2nd, and 3rd editions (http://p2p.wrox.com/forumdisplay.php?f=51)
-   -   PublishObject Publish method is failing (http://p2p.wrox.com/showthread.php?t=50431)

lmariocd November 17th, 2006 10:15 AM

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.




All times are GMT -4. The time now is 01:45 PM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.