PDA

View Full Version : HTML save not working



ashulman
07-12-2012, 11:09 AM
This code keeps failing on the .Publish (True) statement. I have this embedded in a sheet. I can't see where my syntax is wrong. Other code follows it but I didn't post because I didn't think it mattered.

Private Sub CommandButton1_Click()
Dim kfilename
Dim nextrow
kfilename = Trim(Cells(1, 3).Value)
Range("A1:K63").Select
With ActiveWorkbook.PublishObjects.Add(xlSourceRange, _
"Z:\Shulman_A\NY k12\Data\2012\" + kfilename + ".htm", "1", _
"$A$1:$K$63", xlHtmlStatic, "NY K12 Auto Rating_26389", "")
.Publish (True)
.AutoRepublish = False
End With

Aussiebear
07-12-2012, 04:08 PM
Try changing this line from
.Publish (True)
to
.Publish = True