This commit is contained in:
louiscklaw
2025-02-01 01:56:37 +08:00
commit c8a1aa8213
49 changed files with 786 additions and 0 deletions

31
.gitattributes vendored Normal file
View File

@@ -0,0 +1,31 @@
*.mp4 filter=lfs diff=lfs merge=lfs
*.zip filter=lfs diff=lfs merge=lfs
*.7z filter=lfs diff=lfs merge=lfs
*.tar.gz filter=lfs diff=lfs merge=lfs
*.jpg filter=lfs diff=lfs merge=lfs
*.png filter=lfs diff=lfs merge=lfs
*.avif filter=lfs diff=lfs merge=lfs
*.webm filter=lfs diff=lfs merge=lfs
*.mkv filter=lfs diff=lfs merge=lfs
# Documents
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain
*.gif filter=lfs diff=lfs merge=lfs
*.GIF filter=lfs diff=lfs merge=lfs
*.bmp filter=lfs diff=lfs merge=lfs
*.BMP filter=lfs diff=lfs merge=lfs
*.tiff filter=lfs diff=lfs merge=lfs
*.TIFF filter=lfs diff=lfs merge=lfs
*.wav filter=lfs diff=lfs merge=lfs
*.WAV filter=lfs diff=lfs merge=lfs
*.log filter=lfs diff=lfs merge=lfs

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
**/~*.*

View File

@@ -0,0 +1,12 @@
# EditorConfig is awesome: https://EditorConfig.org
# top-most EditorConfig file
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = crlf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = false

BIN
_helloworld_vba/Book1.xlsm Normal file

Binary file not shown.

View File

@@ -0,0 +1,19 @@
VERSION 5.00
Begin {C62A69F0-16DC-11CE-9E98-00AA00574A4F} HelloworldForm
Caption = "UserForm1"
ClientHeight = 3015
ClientLeft = 120
ClientTop = 465
ClientWidth = 4560
OleObjectBlob = "HelloworldForm.frx":0000
StartUpPosition = 1 'CenterOwner
End
Attribute VB_Name = "HelloworldForm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub CommandButton1_Click()
MsgBox "Hello, World aaaaa11111!"
End Sub

Binary file not shown.

View File

@@ -0,0 +1,16 @@
Attribute VB_Name = "Module1"
Sub HelloWorld()
MsgBox "Hello, World 111111!"
End Sub
Sub HelloWorld1()
MsgBox "Hello, World1!"
End Sub
Sub HelloWorld2()
MsgBox "Hello, World1!"
End Sub
Sub HelloWorld3()
MsgBox "Hello, World1!"
End Sub

View File

@@ -0,0 +1,8 @@
Attribute VB_Name = "Module2"
Sub HelloWorld22()
MsgBox "Hello, World!"
End Sub
Sub HelloWorld21()
MsgBox "Hello, World1!"
End Sub

View File

@@ -0,0 +1,12 @@
{
"name": "xlwings-tryout",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC"
}

4
_helloworld_vba/up.bat Normal file
View File

@@ -0,0 +1,4 @@
xlwings addin install
xlwings vba edit --file .\Book1.xlsm
@REM xlwings quickstart -s hello_quickstart

236
diagram.drawio Normal file
View File

@@ -0,0 +1,236 @@
<mxfile host="app.diagrams.net" modified="2023-04-15T07:06:34.883Z" agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36" etag="1ak7x28XaoDP8CpgV_YR" version="21.1.8" type="device">
<diagram name="Page-1" id="05fWngS16l91GcL6yIBs">
<mxGraphModel dx="2739" dy="1075" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<mxCell id="Sxxe-mvxAXtsPCkKtpcs-29" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="-370" y="600" width="600" height="700" as="geometry" />
</mxCell>
<mxCell id="Sxxe-mvxAXtsPCkKtpcs-1" value="&lt;p class=&quot;MsoNormal&quot;&gt;Acquire user input of two workbook (membered, sales_record)&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;check head row to validate user input&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;validate workbook and worksheet&amp;nbsp;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;code:ValidateMemberInformationXlsx()&lt;br&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;code:ValidateSalesRecord()&lt;/p&gt;" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="-110" y="50" width="370" height="160" as="geometry" />
</mxCell>
<mxCell id="Sxxe-mvxAXtsPCkKtpcs-2" value="&lt;p class=&quot;MsoNormal&quot;&gt;OK&lt;/p&gt;" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="-110" y="310" width="140" height="70" as="geometry" />
</mxCell>
<mxCell id="Sxxe-mvxAXtsPCkKtpcs-3" value="&lt;p class=&quot;MsoNormal&quot;&gt;Fail&lt;/p&gt;" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="120" y="310" width="140" height="70" as="geometry" />
</mxCell>
<mxCell id="Sxxe-mvxAXtsPCkKtpcs-4" value="" style="endArrow=classic;html=1;rounded=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="Sxxe-mvxAXtsPCkKtpcs-1" target="Sxxe-mvxAXtsPCkKtpcs-2">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="20" y="390" as="sourcePoint" />
<mxPoint x="70" y="340" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="Sxxe-mvxAXtsPCkKtpcs-5" value="" style="endArrow=classic;html=1;rounded=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;exitX=0.614;exitY=1.014;exitDx=0;exitDy=0;exitPerimeter=0;" edge="1" parent="1" source="Sxxe-mvxAXtsPCkKtpcs-1" target="Sxxe-mvxAXtsPCkKtpcs-3">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="50" y="220" as="sourcePoint" />
<mxPoint x="-50" y="320" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="Sxxe-mvxAXtsPCkKtpcs-6" value="enable further generation" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="-110" y="480" width="140" height="60" as="geometry" />
</mxCell>
<mxCell id="Sxxe-mvxAXtsPCkKtpcs-7" value="loop user until&amp;nbsp;&lt;br&gt;valid sales_record&lt;br&gt;and member information found" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="120" y="480" width="140" height="60" as="geometry" />
</mxCell>
<mxCell id="Sxxe-mvxAXtsPCkKtpcs-8" value="" style="endArrow=classic;html=1;rounded=0;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="Sxxe-mvxAXtsPCkKtpcs-3" target="Sxxe-mvxAXtsPCkKtpcs-7">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="240" y="430" as="sourcePoint" />
<mxPoint x="290" y="380" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="Sxxe-mvxAXtsPCkKtpcs-9" value="" style="endArrow=classic;html=1;rounded=0;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="Sxxe-mvxAXtsPCkKtpcs-7" target="Sxxe-mvxAXtsPCkKtpcs-1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="300" y="520" as="sourcePoint" />
<mxPoint x="340" y="420" as="targetPoint" />
<Array as="points">
<mxPoint x="320" y="510" />
<mxPoint x="320" y="130" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="Sxxe-mvxAXtsPCkKtpcs-11" value="" style="endArrow=classic;html=1;rounded=0;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="Sxxe-mvxAXtsPCkKtpcs-2" target="Sxxe-mvxAXtsPCkKtpcs-6">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="60" y="420" as="sourcePoint" />
<mxPoint x="110" y="370" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="Sxxe-mvxAXtsPCkKtpcs-12" value="member xlsx&lt;br&gt;OpenWorkbookMemberInformation" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="-270" y="670" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="Sxxe-mvxAXtsPCkKtpcs-13" value="sales_record xlsx&lt;br&gt;OpenWorkbookSalesRecord" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="-110" y="650" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="Sxxe-mvxAXtsPCkKtpcs-14" value="filtering" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="-240" y="880" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="Sxxe-mvxAXtsPCkKtpcs-15" value="filtering" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="-70" y="880" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="Sxxe-mvxAXtsPCkKtpcs-16" value="parse" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="-240" y="780" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="Sxxe-mvxAXtsPCkKtpcs-17" value="parse" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="-70" y="780" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="Sxxe-mvxAXtsPCkKtpcs-20" value="combine&lt;br&gt;WriteMonthlySalesReport" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="-160" y="990" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="Sxxe-mvxAXtsPCkKtpcs-21" value="write report" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="-160" y="1210" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="Sxxe-mvxAXtsPCkKtpcs-22" value="" style="endArrow=classic;html=1;rounded=0;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.75;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="Sxxe-mvxAXtsPCkKtpcs-15" target="Sxxe-mvxAXtsPCkKtpcs-20">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="80" y="1030" as="sourcePoint" />
<mxPoint x="130" y="980" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="Sxxe-mvxAXtsPCkKtpcs-23" value="" style="endArrow=classic;html=1;rounded=0;exitX=0.5;exitY=1;exitDx=0;exitDy=0;" edge="1" parent="1" source="Sxxe-mvxAXtsPCkKtpcs-12" target="Sxxe-mvxAXtsPCkKtpcs-16">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="90" y="1040" as="sourcePoint" />
<mxPoint x="140" y="990" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="Sxxe-mvxAXtsPCkKtpcs-24" value="" style="endArrow=classic;html=1;rounded=0;exitX=0.5;exitY=1;exitDx=0;exitDy=0;" edge="1" parent="1" source="Sxxe-mvxAXtsPCkKtpcs-13">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="-10.419999999999987" y="740" as="sourcePoint" />
<mxPoint x="-10.419999999999987" y="780" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="Sxxe-mvxAXtsPCkKtpcs-25" value="" style="endArrow=classic;html=1;rounded=0;exitX=0.5;exitY=1;exitDx=0;exitDy=0;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="-10.419999999999987" y="840" as="sourcePoint" />
<mxPoint x="-10.419999999999987" y="880" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="Sxxe-mvxAXtsPCkKtpcs-26" value="" style="endArrow=classic;html=1;rounded=0;exitX=0.5;exitY=1;exitDx=0;exitDy=0;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="-180.42" y="840" as="sourcePoint" />
<mxPoint x="-180.42" y="880" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="Sxxe-mvxAXtsPCkKtpcs-27" value="" style="endArrow=classic;html=1;rounded=0;exitX=0.5;exitY=1;exitDx=0;exitDy=0;" edge="1" parent="1" source="Sxxe-mvxAXtsPCkKtpcs-14" target="Sxxe-mvxAXtsPCkKtpcs-20">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="-0.4199999999999875" y="850" as="sourcePoint" />
<mxPoint x="-0.4199999999999875" y="890" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="Sxxe-mvxAXtsPCkKtpcs-30" value="GenMonthlySalesReport" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1">
<mxGeometry x="-360" y="610" width="150" height="30" as="geometry" />
</mxCell>
<mxCell id="Sxxe-mvxAXtsPCkKtpcs-31" value="sales_record xlsx&lt;br&gt;ReadProductListNew" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="70" y="650" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="Sxxe-mvxAXtsPCkKtpcs-32" value="" style="endArrow=classic;html=1;rounded=0;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="Sxxe-mvxAXtsPCkKtpcs-31" target="Sxxe-mvxAXtsPCkKtpcs-33">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="110" y="710" as="sourcePoint" />
<mxPoint x="149.58" y="780" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="Sxxe-mvxAXtsPCkKtpcs-33" value="parse product list&lt;br&gt;output as dictionary&lt;br&gt;dicProfit" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="70" y="780" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="Sxxe-mvxAXtsPCkKtpcs-34" value="" style="endArrow=classic;html=1;rounded=0;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" target="Sxxe-mvxAXtsPCkKtpcs-20">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="129.58" y="840" as="sourcePoint" />
<mxPoint x="129.58" y="910" as="targetPoint" />
<Array as="points">
<mxPoint x="90" y="990" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="Sxxe-mvxAXtsPCkKtpcs-35" value="prepare report&lt;br&gt;layout" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="-160" y="1100" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="Sxxe-mvxAXtsPCkKtpcs-36" value="" style="endArrow=classic;html=1;rounded=0;exitX=0.5;exitY=1;exitDx=0;exitDy=0;" edge="1" parent="1" source="Sxxe-mvxAXtsPCkKtpcs-20" target="Sxxe-mvxAXtsPCkKtpcs-35">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="80" y="1070" as="sourcePoint" />
<mxPoint x="130" y="1020" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="Sxxe-mvxAXtsPCkKtpcs-37" value="" style="endArrow=classic;html=1;rounded=0;exitX=0.5;exitY=1;exitDx=0;exitDy=0;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="-100.42" y="1160" as="sourcePoint" />
<mxPoint x="-100.42" y="1210" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="Sxxe-mvxAXtsPCkKtpcs-38" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="340" y="570" width="600" height="700" as="geometry" />
</mxCell>
<mxCell id="Sxxe-mvxAXtsPCkKtpcs-40" value="sales_record xlsx&lt;br&gt;OpenWorkbookSalesRecord" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="600" y="620" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="Sxxe-mvxAXtsPCkKtpcs-42" value="filtering" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="640" y="850" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="Sxxe-mvxAXtsPCkKtpcs-44" value="parse" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="640" y="750" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="Sxxe-mvxAXtsPCkKtpcs-45" value="combine&lt;br&gt;WriteMonthlySalesReport" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="550" y="960" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="Sxxe-mvxAXtsPCkKtpcs-46" value="write report" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="550" y="1180" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="Sxxe-mvxAXtsPCkKtpcs-47" value="" style="endArrow=classic;html=1;rounded=0;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.75;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="Sxxe-mvxAXtsPCkKtpcs-42" target="Sxxe-mvxAXtsPCkKtpcs-45">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="790" y="1000" as="sourcePoint" />
<mxPoint x="840" y="950" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="Sxxe-mvxAXtsPCkKtpcs-49" value="" style="endArrow=classic;html=1;rounded=0;exitX=0.5;exitY=1;exitDx=0;exitDy=0;" edge="1" parent="1" source="Sxxe-mvxAXtsPCkKtpcs-40">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="699.58" y="710" as="sourcePoint" />
<mxPoint x="699.58" y="750" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="Sxxe-mvxAXtsPCkKtpcs-50" value="" style="endArrow=classic;html=1;rounded=0;exitX=0.5;exitY=1;exitDx=0;exitDy=0;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="699.58" y="810" as="sourcePoint" />
<mxPoint x="699.58" y="850" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="Sxxe-mvxAXtsPCkKtpcs-53" value="GenMonthlySalesReport" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1">
<mxGeometry x="350" y="580" width="150" height="30" as="geometry" />
</mxCell>
<mxCell id="Sxxe-mvxAXtsPCkKtpcs-54" value="sales_record xlsx&lt;br&gt;ReadProductListNew" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="780" y="620" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="Sxxe-mvxAXtsPCkKtpcs-55" value="" style="endArrow=classic;html=1;rounded=0;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="Sxxe-mvxAXtsPCkKtpcs-54" target="Sxxe-mvxAXtsPCkKtpcs-56">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="820" y="680" as="sourcePoint" />
<mxPoint x="859.58" y="750" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="Sxxe-mvxAXtsPCkKtpcs-56" value="parse product list&lt;br&gt;output as dictionary&lt;br&gt;dicProfit" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="780" y="750" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="Sxxe-mvxAXtsPCkKtpcs-57" value="" style="endArrow=classic;html=1;rounded=0;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" target="Sxxe-mvxAXtsPCkKtpcs-45">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="839.58" y="810" as="sourcePoint" />
<mxPoint x="839.58" y="880" as="targetPoint" />
<Array as="points">
<mxPoint x="800" y="960" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="Sxxe-mvxAXtsPCkKtpcs-58" value="prepare report&lt;br&gt;layout" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="550" y="1070" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="Sxxe-mvxAXtsPCkKtpcs-59" value="" style="endArrow=classic;html=1;rounded=0;exitX=0.5;exitY=1;exitDx=0;exitDy=0;" edge="1" parent="1" source="Sxxe-mvxAXtsPCkKtpcs-45" target="Sxxe-mvxAXtsPCkKtpcs-58">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="790" y="1040" as="sourcePoint" />
<mxPoint x="840" y="990" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="Sxxe-mvxAXtsPCkKtpcs-60" value="" style="endArrow=classic;html=1;rounded=0;exitX=0.5;exitY=1;exitDx=0;exitDy=0;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="609.58" y="1130" as="sourcePoint" />
<mxPoint x="609.58" y="1180" as="targetPoint" />
</mxGeometry>
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>

7
gitUpdate.bat Normal file
View File

@@ -0,0 +1,7 @@
git status .
@pause
git add .
git commit -m"update AC24542,"
start git push

16
gitUpdate.sh Executable file
View File

@@ -0,0 +1,16 @@
#!/usr/bin/env bash
set -ex
git config --global http.version HTTP/1.1
git config --global lfs.allowincompletepush true
git config --global lfs.locksverify true
git config --global http.postBuffer 5368709120
git add .
git commit -m 'update,'
git push
echo "done"

Binary file not shown.

13
package.json Normal file
View File

@@ -0,0 +1,13 @@
{
"name": "ac24542",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"gitUpdate": "git add . && git commit -m\"update AC24542,\" && git push"
},
"keywords": [],
"author": "",
"license": "ISC"
}

View File

@@ -0,0 +1,12 @@
# EditorConfig is awesome: https://EditorConfig.org
# top-most EditorConfig file
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = crlf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = false

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,70 @@
'Force the explicit declaration of variables
Option Explicit
Sub SortDictionaryByItem()
'Set a reference to Microsoft Scripting Runtime by using
'Tools > References in the Visual Basic Editor (Alt+F11)
'Declare the variables
Dim Dict As Scripting.Dictionary
Dim Arr() As Variant
Dim Temp1 As Variant
Dim Temp2 As Variant
Dim Txt As String
Dim i As Long
Dim j As Long
'Create an instance of the Dictionary
Set Dict = New Dictionary
'Set the comparison mode to perform a textual comparison
Dict.CompareMode = TextCompare
'Add keys and items to the Dictionary
Dict.Add "Mango", "M250"
Dict.Add "Kiwi", "K150"
Dict.Add "Apple", "A325"
Dict.Add "Peach", "P350"
Dict.Add "Lime", "L275"
'Allocate storage space for the dynamic array
ReDim Arr(0 To Dict.Count - 1, 0 To 1)
'Fill the array with the keys and items from the Dictionary
For i = 0 To Dict.Count - 1
Arr(i, 0) = Dict.Keys(i)
Arr(i, 1) = Dict.Items(i)
Next i
'Sort the array using the bubble sort method
For i = LBound(Arr, 1) To UBound(Arr, 1) - 1
For j = i + 1 To UBound(Arr, 1)
If Arr(i, 1) > Arr(j, 1) Then
Temp1 = Arr(j, 0)
Temp2 = Arr(j, 1)
Arr(j, 0) = Arr(i, 0)
Arr(j, 1) = Arr(i, 1)
Arr(i, 0) = Temp1
Arr(i, 1) = Temp2
End If
Next j
Next i
'Clear the Dictionary
Dict.RemoveAll
'Add the sorted keys and items from the array back to the Dictionary
For i = LBound(Arr, 1) To UBound(Arr, 1)
Dict.Add Key:=Arr(i, 0), Item:=Arr(i, 1)
Next i
'Build a list of keys and items from the Dictionary
For i = 0 To Dict.Count - 1
Txt = Txt & Dict.Keys(i) & vbTab & Dict.Items(i) & vbCrLf
Next i
'Display the list in a message box
MsgBox Txt, vbInformation
End Sub

View File

@@ -0,0 +1,57 @@
# source dataset
which they have the common column `Member ID`.
- `workbook_salesrecord.xlsm`
- the spending of members
- `workbook_memberInformation.xlsm`
- salaries
- marital status
- birthdays in the month
# generated
- `workbook_sales_report.xlsm` sales report workbook
- i `weekly_sales_report.xlsm`
- from the `workbook_salesrecord`
- reporting the __weekly unit sales__ of different region.
- It show the number of products sold by different regions. (Pic.3)
- It also generate the `pie chart` to visible the data. (Pic.4)
- __weekly profit report__ for different product.
- It shows the total number of products sold at that week. (Pic.5)
- Also, the __frequency table__ of type of product will be calculated and shown. (Pic. 6)
- unit sales of product chart
- unit sales chart
- profit of product type chart (Pic.7)
- ii `monthly_sales_report.xlsm`
- from the `workbook_salesrecord`
- `first report`
- fields
- product
- quantity sales
- Revenue
- Cost
- profit margin for different region
- the total profit
- the summary statistic of the profit
- product analysis
- calculating and profit margin of each product
- `Margin` is calculated by `( Profit / Revenue )`
- `workbook_membership_and_discount.xlsm`
- Membership and Discount workbook
- fields:
- Member ID
- total amount spending
- birthday discount received
- valentine's day discount received
- membership elvel
- amount spended
- discount received
> For example, the `NT002` is having total spending of `240` which is extract for
`workbook_salesrecord` in February.
He had birthday in February and married. The valentines Day discount is depended on Marital status.
He spent $20 at the 13-Feb.
He can received discount of ( 20 - 20 * 0.92 * 0.88 * 0.95 )= 4.6176 in March.

View File

@@ -0,0 +1,61 @@
Objects manipulation and utilisation (46 marks)
• Sufficient workbook manipulation:
At least
two workbooks for the source data sets,
- workbook_salesrecord
- workbook_memberInformation
at least one workbook for the derived data sets,
at least one workbook for the report,
and one workbook for the programme code and Userform.
Sufficiently utilized object variables, references, properties, and methods. (0-5)
• Sufficient worksheet manipulation:
Sufficiently utilized object variables, references, properties, and methods. (0-4)
• Sufficient data manipulation:
Generate at least one new data set in a new workbook by applying non-trivial manipulation on the source data sets. (0-8)
• Create at least
two non-Pivot tables for character variables in the report workbook.
At least one table includes
summary statistics of a numeric variable for each level of the character variable. All elements of the tables, such as
data range,
variables,
statistics, etc.,
must be appropriately coded in the application. (0-4)
• Create at least
one non-Pivot frequency table for a numeric variable in the report workbook.
All elements of the tables, such as
data range,
variables,
statistics, etc.,
must be appropriately coded in the application. (0-3)
• Create at least two types of non-Pivot charts in the report workbook.
All features of the charts, such as
data range,
type of chart,
labels, etc.
of the charts must be appropriately coded in the application. (0-4)
- [ ] Utilise OptionButton control. (0-2)
- [ ] Utilise CheckBox control. (0-2)
- [ ] Utilise RefEdit control. (0-1)
- [ ] Utilise ScrollBar or SpinButton controls. (0-2)
- [ ] Utilise ComboBox control. (0-3)
- [ ] Utilise Frame control. (0-2)
- [ ] Utilise ListBox control. (0-4)
- [ ] Utilise MultiPage control. (0-2)

View File

@@ -0,0 +1,194 @@
CWC drinking shop is a shop is a shop selling drink like
- tea, coffee.
- It also sells ice cream.
- It has three branches in
- Hong Kong Island,
- Kowloon and New Territories
respectively.
## Member discount:
Provide discounts to members based on their spending and the holiday.
The source dataset includes two workbooks:
- `workbook_salesrecord` and
- `workbook_memberInformation`,
- which have the common column `Member ID`.
### The `sales record` gives
- the spending of members,
### The `member information` gives information such as
- salaries,
- marital status,
- and birthdays in the month.
### Rule set
- Customers who accumulate spending above a certain amount can receive a percentage discount.
- Customers can also receive a 10% discount if they purchase items during their own birthday month. Additionally,
- customers who are married can receive a 10% discount if they buy drinks between February 10 and February 14 to celebrate
Valentine's Day.
- Discounts can be used together by multiplying them.
- Memberships are usually upgraded at the end of the month,
### sales reports for members are generated monthly.
- To achieve this objective, two workbooks need to be generated:
- `Workbook_salesreport` and
- `Workbook_Membership&discount`.
- summarize the number of members in each tier and the discount given.
| | Accumulated Spending | Discount |
| ---------------------------------- | -------------------- | -------- |
| Basic | $100 | 1% |
| Advanced | $250 | 5% |
| Platinum | $400 | 10% |
| Birthday | N/A | 8% |
| Valentine's day (10/Feb to 14/Feb) | N/A | 12% |
## Weekly sales report:
- Generate a sales report as a new workbook by extracting data from the `workbook_salesrecord`.
- This report will be generated at the end of each week
- to help the marketing department identify which products have the potential to generate more profit for the company.
## Monthly sales report:
- Generate a sales report as a new workbook by extracting data from the `workbook_salesrecord`.
- This report will be generated at the end of each month and will include the weekly sales report.
- The purpose of this report is to provide a comprehensive overview of sales trends over time.
## Type of Product
| Espresso | Price | Cost |
| ---------------- | ------ | ------ |
| Decaf Espresso | $32.50 | $15.20 |
| Caffe Latte | $25.00 | $12.20 |
| Caffe Mocha | $30.30 | $13.00 |
| Regular Espresso | $22.00 | $14.20 |
| Coffee | Price | Cost |
| --------- | ------ | ------ | ------ | ------ |
| Amaretto | $15.20 | $8.50 |
| Decaf | Irish | Cream | $35.30 | $28.00 |
| Columbian | $20.00 | $15.00 |
| Herbal Tea | Price | Cost |
| ---------- | ------ | ------ | ------ | ------ |
| Amaretto | $15.20 | $8.50 |
| Decaf | Irish | Cream | $35.30 | $28.00 |
| Columbian | $20.00 | $15.00 |
| Herbal Tea | Price | Cost |
| ---------- | ------ | ------ |
| Lemon | $18.50 | $5.50 |
| Chamomile | $21.00 | $14.00 |
| Mint | $18.32 | $8.90 |
| Tea | Price | Cost |
| ---------- | ----- | ----- | ----- |
| Green Tea | 17.50 | 7.00 |
| Earl | Grey | 22.00 | 14.00 |
| Darjeeling | 25.00 | 15.00 |
## Data source description
### The `workbook_MemberInformation` (`MemberInformation.xlsm`) have following column.
- Member ID,
- Gender,
- Age,
- Salary,
- Martial Status,
- Living District and
- Birthday in Month
### The Workbook_salesrecord (`SalesData.xlsm`) have following columns.
- Member ID,
- Order Date,
- Product Name,
- Product Category,
- Quantity,
- Price Per Unit,
- Total sales,
- Total revenue by member ID
### Pic 2 shows the sales record in Hong Kong Island.
There are three worksheets which represent different region in this workbook.
The member ID will be - NTXXX (New Territories), - HKXXX(Hong Kong Island) and - KLXXX(Kowloon).Add case to other region
## Report generated
1. Membership and Discount workbook (Workbook_Membership & discount)
The officer needs to update the `membership` and `discount` workbook monthly to ensure giving correct discount to the customers.
In this workbook, Officer needs to enter the column of
- Member ID,
- total amount
- spending,
- Birthday discount received,
- Valentines Day discount received,
- Membership level,
- Amount spent,
- Amount of discount received.
For example, the `NT002` is having total spending of `240` which is extract for
`workbook_salesrecord` in February.
He had birthday in February and married. The valentines Day discount is depended on Marital status.
He spent $20 at the 13-Feb.
He can received discount of ( 20 - 20 _ 0.92 _ 0.88 \* 0.95 )= 4.6176 in March.
In this workbook report,
1. total amount spending need to be extract from the `workbook_salesrecord` first.
1. Then birthday discount and Valentines Day discount need to be extracted from the `workbook_MemberInformation` because the birthday month and Marital status is the key of determining the discount is `true` or `false`.
## Sales report workbook (Workbook_salesreport)
The first need to be done is weekly report worksheets,
the weekly sales report have two parts,
- the first part is reporting the weekly unit sales of different region.
- It show the number of products sold by different regions.
- It also generate the `pie chart` to visible the data.
- The second thing need to be done for weekly report is generate weekly profit report for different product.
- It shows the total number of products sold at that week.
- Also, the frequency table of type of product will be calculated and shown.
The data of weekly sales will be shown as chart in product type, unit sales and profit.
The unit sales of product type can help company to know what customers would like to buy.
The Unit sales in product can point out more specifically of what product the
customer would like to buy.
The profit chart shows the profit generated by that week.
It may help company to adjust the inventory in next week.
Another report would be generated is `Monthly sales and profit report`.
The report will generate the
- quantity sales,
- Revenue and Cost, and
- profit margin for different region respectively.
- It will also calculate the total profit and he summary statistic of the profit.
The data is extracted the source data `Workbook_salesrecord`.
With analyzing the data, marketing strategies for different region can be suggested.
The second of Monthly report is Product analysis, by calculating and profit margin of each product. Company can know which product having a higher margin can generate higher profit in future. New variable `Margin` is calculated by `( Profit / Revenue )`.
It shows only few products have a relatively high margin for selling.
With acknowledging the Frequency of customers spending, company can know who is target customers, and adjust price in the future.

Binary file not shown.

Binary file not shown.

BIN
quote1/workspace/cost.xlsx Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,12 @@
{
"name": "xlwings-tryout",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC"
}

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,5 @@
@REM xlwings addin install
xlwings vba edit --file .\report.xlsm
@REM xlwings quickstart -s hello_quickstart

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 219 KiB

BIN
quote2/Chapter1_2022.pptx Normal file

Binary file not shown.

BIN
quote2/Chapter2_2022.pptx Normal file

Binary file not shown.

BIN
quote2/Chapter3_2022.pptx Normal file

Binary file not shown.

BIN
quote2/Chapter4_2022.pptx Normal file

Binary file not shown.