Hi Guys can any one help with this bit of code.
I am simply tring to save a selection of a spreadsheet as an HTML file in a certain file. The file name is made up of variables (l, yyy, zzz, aaa) and so is the spreadsheet name (Nam). However the code bugs on the with Activeworkbook line.
Can any one see where I am going wrong.
Much appreciated for any help given.
I am simply tring to save a selection of a spreadsheet as an HTML file in a certain file. The file name is made up of variables (l, yyy, zzz, aaa) and so is the spreadsheet name (Nam). However the code bugs on the with Activeworkbook line.
Can any one see where I am going wrong.
Much appreciated for any help given.
Code:
l= Cells(13, 10).Value
yyy = "C:\Arc\"
zzz = "\"
aaa = ".mht"
xxx = yyy & zzz & l & aaa
nam = Activesheet.name
'saves as HTML file
Range("A1:K55").Select
With ActiveWorkbook.PublishObjects(Nam)
.HtmlType = xlHtmlStatic
.Filename = xxx
.Publish (False)
.AutoRepublish = False
End With
ChDir "C:\Phils Folder"