View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
K[_2_] K[_2_] is offline
external usenet poster
 
Posts: 557
Default PLEASE CAN ANYBODY CORRECT THIS MACRO

Hi all, I got excel 2007 and I am trying to Save As Range ("A2:F23")
as Web Page file format. I have done it but I want sheet to be
Activesheet and file name to be Range("H2") for which I done the macro
below but its giving error. Can any friend can help me in this i'll be
very thankful to him.

Sub SAV()
Dim SH As Sheets
Dim NA As Range
SH = ActiveSheet
NA = Range("H2").Value
Range("A2:F23").Select
With ActiveWorkbook.PublishObjects.Add(xlSourceRange, _
"C:\Documents and Settings\kamranr\My Documents\NA.htm", SH, _
"$A$2:$F$23", xlHtmlStatic, , "")
.Publish (True)
.AutoRepublish = False
End With
Range("A2").Select
End Sub