Sam Longstaff
Member
Hi,
I would like a VBA solution that will hide specified sheets but only when the workbook is saved as a .mht file type. The workbook in question will also be saved as a .xlsm in the first instance and then when published be saved as a .mht
I have found:
This doesn't quite work for me as it is not specific enough to my save as requirements.
Any ideas?
I would like a VBA solution that will hide specified sheets but only when the workbook is saved as a .mht file type. The workbook in question will also be saved as a .xlsm in the first instance and then when published be saved as a .mht
I have found:
Code:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, _ Cancel As Boolean)
Cancel = True
Worksheets("My Sheet").Visible = xlSheetHidden
ThisWorkbook.Save
End Sub
This doesn't quite work for me as it is not specific enough to my save as requirements.
Any ideas?
Last edited by a moderator: