-
Notifications
You must be signed in to change notification settings - Fork 4
/
create.wsf
33 lines (23 loc) · 861 Bytes
/
create.wsf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<job>
<script language="VBScript" src="..\..\..\TF\DWH_DM_RISKFINANCE\lib\VBA\VBScript-App-Creator\create-MS-Office-App.vbs" />
<script language="VBScript">
option explicit
dim wb
set wb = createOfficeApp("excel", currentDir() & "codeNameExample.xlsm")
if wb is nothing then ' {
wscript.echo("Could not create excel Workbook.")
wscript.quit(-1)
end if ' }
dim app : set app = wb.application
dim sh_1 : set sh_1 = insertSheet(wb, "first sheet" , "shOne")
dim sh_2 : set sh_1 = insertSheet(wb, "Second sheet", "shTwo")
insertModule app, currentDir() & "shOne.vb", "shOne", 1
insertModule app, currentDir() & "shTwo.vb", "shTwo", 1
insertModule app, currentDir() & "func.vb" , "func" , 1
wb.save
if not compileApp(app) then
wscript.echo("! compilation failed !")
end if
app.run "main"
' app.quit
</script> </job>