@@ -156,7 +156,7 @@ strPathOfBuild = CurrentWB.Path & "\src\vbaDeveloper.xlam\Build.bas"
156
156
NewWB.VBProject.VBComponents.Import strPathOfBuild
157
157
158
158
'Rename the project (in the VBA) to vbaDeveloper
159
- NewWB.VBProject.Name = TOOL_NAME & "_pkg"
159
+ NewWB.VBProject.Name = TOOL_NAME
160
160
161
161
'Add references to the library
162
162
'Microsoft Scripting Runtime
@@ -165,15 +165,30 @@ NewWB.VBProject.VBComponents.Import strPathOfBuild
165
165
'Microsoft Visual Basic for Applications Extensibility 5.3
166
166
NewWB.VBProject.References.AddFromGuid "{0002E157-0000-0000-C000-000000000046}" , 5 , 3
167
167
168
- 'Save file as .xlsm
168
+ 'In VB Editor, press F4, then under Microsoft Excel Objects, select ThisWorkbook.Set the property 'IsAddin' to TRUE
169
+ NewWB.IsAddin = True
170
+ 'In VB Editor, menu File-->Save Book1; Save as vbaDeveloper.xlam in the same directory as 'src'
171
+
172
+ 'Save file as .xlam
169
173
strLocationXLAM = CurrentWB.Path
170
- NewWB.SaveAs strLocationXLAM & "\" & TOOL_NAME & "_pkg" & ".xlsm" , xlOpenXMLWorkbookMacroEnabled
171
-
172
- 'Close excel. Open excel with a new workbook, then open the just saved vbaDeveloper.xlsm
174
+ Application.DisplayAlerts = False
175
+ NewWB.SaveAs strLocationXLAM & "\" & TOOL_NAME & ".xlam" , xlOpenXMLAddIn
176
+ Application.DisplayAlerts = True
177
+
178
+ 'Close and reopen the file
173
179
NewWB.Close savechanges:=False
180
+ Set NewWB = Workbooks.Open (strLocationXLAM & "\" & TOOL_NAME & ".xlam" )
181
+
182
+ Application.Wait TimeSerial(Hour(Now()), Minute(Now()), Second(Now()) + 5 )
174
183
175
184
'Run the Build macro in vbaDeveloper
176
- Application.Run "vbaDeveloper.xlsm!Build.testImport"
185
+ Application.OnTime Now + TimeValue("00:00:05" ), "vbaDeveloper.xlam!Build.testImport"
186
+ Application.OnTime Now + TimeValue("00:00:12" ), "installer.xls!SaveFile"
177
187
178
188
End Sub
179
189
190
+ Sub SaveFile ()
191
+ Workbooks("vbaDeveloper.xlam" ).Save
192
+ ThisWorkbook.Saved = True
193
+ Application.Quit
194
+ End Sub
0 commit comments