Skip to content

Commit 39e0751

Browse files
committed
Export Installer module on save
1 parent 1bcc76f commit 39e0751

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

Installer.xls

2.5 KB
Binary file not shown.

src/Installer.xls/ThisWorkbook.sheet.cls

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,18 @@ Private Sub Workbook_Open()
1212
End Sub
1313

1414
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
15-
'PURPOSE: Make sure that the Installer module is not included when the file is saved
15+
'PURPOSE: Make sure that the Installer module is exported and then deleted, so it is not included when the file is saved
1616

1717
On Error Resume Next
18+
Call ExportInstallerModule
1819
ThisWorkbook.VBProject.VBComponents.Remove ThisWorkbook.VBProject.VBComponents("Installer")
1920
On Error GoTo 0
2021

2122
End Sub
23+
24+
Sub ExportInstallerModule()
25+
Dim wb As Workbook
26+
Set wb = ThisWorkbook
27+
wb.VBProject.VBComponents("Installer").Export (wb.Path & "\Installer.bas")
28+
29+
End Sub

0 commit comments

Comments
 (0)