View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.newusers
steve steve is offline
external usenet poster
 
Posts: 8
Default Why doesnt this work

Dear All,

Can you have a look at this and please tell why it doesnt work




Sub CopySheetAsHTML()

Dim fName As String
Dim wks As Worksheet

Set wks = ActiveSheet
fName = wks.Range("J4").Value

With ActiveWorkbook.PublishObjects.Add(xlSourceSheet, _
"I:\" & fName & ".htm", wks.Name, "DataRange", _
xlHtmlStatic, wks.Range("J4").Value)
.Publish (True)
End With
End Sub




Many Thanks in advance



Steve