Having trouble with this script
What I want to do:
Save 2 copies as single page webpages to different folders, and a 3rd copy (in a different folder), in excel format.
The above script instead saves a web and excel version in test 3.
Code:
Sub Save1()
Dim dag, uur, tussen, xlsline, webline
dag = CStr(Date)
tijd = CStr(Hour(Time))
If Hour(Time) < 10 Then tussen = "0" Else tussen = ""
xlsline = InputBox("Under what name should the product be saved?", "Save as", dag + "-test XXX.xls")
MsgBox (xlsline)
webline = InputBox("Under what name should the product be saved?", "Save as", dag + "-test XXX.mht")
MsgBox (webline)
ChDir _
"C:\Test1"
Range("B2:H23").Select
With ActiveWorkbook.PublishObjects.add(xlSourceRange, _
webline _
, "WWA", "$B$2:$H$23", xlHtmlStatic, "WWA1_16010", "")
.Publish (True)
.AutoRepublish = False
End With
ChDir _
"C:\Test2"
Range("B2:H23").Select
With ActiveWorkbook.PublishObjects.add(xlSourceRange, _
webline _
, "WWA", "$B$2:$H$23", xlHtmlStatic, "WWA1_16010", "")
.Publish (True)
.AutoRepublish = False
End With
ChDir "C:\test3"
ActiveWorkbook.SaveAs Filename:=xlsline, FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
End Sub
What I want to do:
Save 2 copies as single page webpages to different folders, and a 3rd copy (in a different folder), in excel format.
The above script instead saves a web and excel version in test 3.