试试下面的代码,是将sheet1 保存为 html格式。
Sub Chief()
iPath = ThisWorkbook.Path & "\" '(保存路径为当前工作簿所在路径)
myN = ActiveSheet.Name
ActiveSheet.Copy
ActiveWorkbook.SaveAs Filename:=iPath & myN & ".html", FileFormat:=xlHtml, ReadOnlyRecommended:=False, CreateBackup:=False
'(工作表名称为文件名)
ActiveWorkbook.Close
End Sub
'打开询问时不启用ACTIVEX即可