Publishing a Range

A

akay26

I hope someone cvan help me. Below is some code that I am trying to get to
work but no luck.

Sub Pub_Chart_To_Web()
Dim myWebPage as Range
Sheets("Sheet1").Select
Set myWebpage = Range("Part3").Value
Sheets("Chart").Select
Application.Run "A_ChartLinks_FormatFix"
Range("Chart_PubToWeb").Select
With ActiveWorkBook.PublishObjects.Add( _
SourceType:=xlSourceRange, _
Filename:=myWebpage, _
Sheet:="Chart", _
Source:="Chart_PubToWeb", _
HtmlType:=xlHtmlStatic).Publish(True)
End With
End Sub

Part3 is a named range on Sheet1 = "\\mchomek\shane\newchart.mht" (with
quote mark).

The code above is giving me a expected function error with .Publish
highlighted.

Thanks,
Shane
 
J

Jim Thomlinson

Assuming that myWebpage is a range object then remove the .value from the
end...

Set myWebpage = Range("Part3")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top