Skip to content
Open

S #2227

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 4 additions & 15 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,15 +1,4 @@
.DS_Store
.idea
*.json
*.out
*.test
~$*.xlsx
test/*.png
test/BadWorkbook.SaveAsEmptyStruct.xlsx
test/Encryption*.xlsx
test/excelize-*
test/Test*.xlam
test/Test*.xlsm
test/Test*.xlsx
test/Test*.xltm
test/Test*.xltx
/node_modules
logs
/xvba_excel_backup
.gitignore
119 changes: 119 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"args": [
"--extensionDevelopmentPath=${workspaceFolder}"
],
"name": "Launch Extension",
"outFiles": [
"${workspaceFolder}/out/**/*.js"
],
"preLaunchTask": "npm",
"request": "launch",
"type": "extensionHost"
},
{
"type": "java",
"name": "Attach to Remote Program",
"request": "attach",
"hostName": "<The host name or ip address of remote debuggee>",
"port": "<debug port of remote debuggee>"
},
{
"name": "Connect to server",
"type": "go",
"request": "attach",
"mode": "remote",
"remotePath": "${workspaceFolder}",
"port": 2345,
"host": "127.0.0.1"
},
{
"command": "npm start",
"name": "Run npm start",
"request": "launch",
"type": "node-terminal"
},
{
"name": "Launch file",
"type": "go",
"request": "launch",
"mode": "debug",
"program": "${file}"
},
{
"command": "npm start",
"name": "Run npm start",
"request": "launch",
"type": "node-terminal"
},
{
"type": "java",
"name": "Launch Java Program",
"request": "launch",
"mainClass": ""
},
{
"command": "npm start",
"name": "Run npm start",
"request": "launch",
"type": "node-terminal"
},
{
"command": "npm start",
"name": "Run npm start",
"request": "launch",
"type": "node-terminal"
},
{
"command": "npm start",
"name": "Run npm start",
"request": "launch",
"type": "node-terminal"
},
{
"name": "Launch file",
"type": "go",
"request": "launch",
"mode": "debug",
"program": "${file}"
},
{
"name": "Python Debugger: Module",
"type": "debugpy",
"request": "launch",
"module": "enter-your-modulgoae-name"
},
{
"name": "Launch Package",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}
"
},
{
"args": [
"--extensionDevelopmentPath=${workspaceFolder}"
],
"name": "Launch Extension",
"outFiles": [
"${workspaceFolder}/out/**/*.js"
],
"preLaunchTask": "npm",
"request": "launch",
"type": "extensionHost"
},
{
"name": "Launch Package",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${fileDirname}"
}
]
}
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"githubPullRequests.ignoredPullRequestBranches": [
"master"
]
}
14 changes: 14 additions & 0 deletions config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"app_name": "XVBA",
"description": "",
"author": "",
"email": "",
"create_ate": "Fri Oct 24 2025 01:59:24 GMT-0600 (Central Standard Time)",
"excel_file": "index.xlsb",
"vba_folder": "vba-files",
"ribbon_file": "customUI14",
"ribbon_folder": "ribbons",
"logs": "on",
"xvba_packages": {},
"xvba_dev_packages": {}
}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ require (
github.com/xuri/efp v0.0.1
github.com/xuri/nfp v0.0.2-0.20250530014748-2ddeb826f9a9
golang.org/x/crypto v0.43.0
golang.org/x/image v0.25.0
golang.org/x/image v0.32.0
golang.org/x/net v0.46.0
golang.org/x/text v0.30.0
)
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ golang.org/x/crypto v0.43.0 h1:dduJYIi3A3KOfdGOHX8AVZ/jGiyPa3IbBozJ5kNuE04=
golang.org/x/crypto v0.43.0/go.mod h1:BFbav4mRNlXJL4wNeejLpWxB7wMbc79PdRGhWKncxR0=
golang.org/x/image v0.25.0 h1:Y6uW6rH1y5y/LK1J8BPWZtr6yZ7hrsy6hFrXjgsc2fQ=
golang.org/x/image v0.25.0/go.mod h1:tCAmOEGthTtkalusGp1g3xa2gke8J6c2N565dTyl9Rs=
golang.org/x/image v0.32.0 h1:6lZQWq75h7L5IWNk0r+SCpUJ6tUVd3v4ZHnbRKLkUDQ=
golang.org/x/image v0.32.0/go.mod h1:/R37rrQmKXtO6tYXAjtDLwQgFLHmhW+V6ayXlxzP2Pc=
golang.org/x/net v0.46.0 h1:giFlY12I07fugqwPuWJi68oOnpfqFnJIJzaIIm2JVV4=
golang.org/x/net v0.46.0/go.mod h1:Q9BGdFy1y4nkUwiLvT5qtyhAnEHgnQ/zd8PfU6nc210=
golang.org/x/text v0.30.0 h1:yznKA/E9zq54KzlzBEAWn1NXSQ8DIp/NYMy88xJjl4k=
Expand Down
Binary file added index.xlsb
Binary file not shown.
15 changes: 15 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "xvba-app",
"version": "1.0.0",
"description": "A XVBA App",
"main": "index.js",
"author": "LocalSmart",
"license": "ISC",
"dependencies": {
"excel-types": "1.0.0",
"Xlog": "1.0.0"
},
"devDependencies": {
"@localsmart/xvba-cli": "^1.0.2"
}
}
15 changes: 15 additions & 0 deletions ribbons/customUI14.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
<ribbon startFromScratch="false">
<tabs>
<tab id="customTab" label="Xvba">
<group id="customGroup1" label="Default">
<button id="btn1" label="Custom-Image" image="home" size="normal" onAction="MyRibbon.btn1" />
<button id="btn2" label="Button-2" imageMso="RightArrow2" size="normal" onAction="MyRibbon.btn2" />
</group>
<group id="customGroup2" label="Second">
<button id="btn3" label="Button-3" imageMso="MasterDocumentShow" size="normal" onAction="MyRibbon.btn3" />
</group>
</tab>
</tabs>
</ribbon>
</customUI>
16 changes: 16 additions & 0 deletions ribbons/examples/Custom OutSpace.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
<backstage>
<tab id="customTab" label="Custom">
<firstColumn>
<taskGroup id="customTaskGroup" label="Custom Task Group">
<category id="tgCategory1" label="Category One">
<task id="task1" label="Task 1" imageMso="FileOpen"/>
<task id="task2" label="Task 2" imageMso="FileSave"/>
<task id="task3" label="Task 3" imageMso="FileSaveAs"/>
</category>
</taskGroup>
</firstColumn>
</tab>
</backstage>
</customUI>
11 changes: 11 additions & 0 deletions ribbons/examples/Custom Tab.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
<ribbon startFromScratch="false">
<tabs>
<tab id="customTab" label="Custom Tab">
<group id="customGroup" label="Custom Group">
<button id="customButton" label="Custom Button" imageMso="HappyFace" size="large" onAction="Callback" />
</group>
</tab>
</tabs>
</ribbon>
</customUI>
18 changes: 18 additions & 0 deletions ribbons/examples/Excel - A Custom Tab.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
<ribbon>
<tabs>
<tab id="customTab" label="Contoso" insertAfterMso="TabHome">
<group idMso="GroupClipboard" />
<group idMso="GroupFont" />
<group id="customGroup" label="Contoso Tools">
<button id="customButton1" label="ConBold" size="large" onAction="conBoldSub" imageMso="Bold" />
<button id="customButton2" label="ConItalic" size="large" onAction="conItalicSub" imageMso="Italic" />
<button id="customButton3" label="ConUnderline" size="large" onAction="conUnderlineSub" imageMso="Underline" />
</group>
<group idMso="GroupEnterDataAlignment" />
<group idMso="GroupEnterDataNumber" />
<group idMso="GroupQuickFormatting" />
</tab>
</tabs>
</ribbon>
</customUI>
6 changes: 6 additions & 0 deletions ribbons/examples/Repurpose.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
<commands>
<command idMso="Bold" enabled="false"/>
<command idMso="Save" onAction="MySave"/>
</commands>
</customUI>
11 changes: 11 additions & 0 deletions ribbons/examples/Word - Group on Insert Tab.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
<ribbon>
<tabs>
<tab idMso="TabInsert">
<group id="customGroup" label="Contoso" insertAfterMso="GroupIllustrations">
<button id="customButton" label="Document ID" size="large" imageMso="ListNumVal" onAction="insertDocID" />
</group>
</tab>
</tabs>
</ribbon>
</customUI>
Binary file added ribbons/images/home.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/Book1.xlsx
Binary file not shown.
Binary file added test/TestAdjustDrawings.xlsx
Binary file not shown.
Binary file added test/TestAdjustFormula.xlsx
Binary file not shown.
Binary file added test/TestAdjustHyperlinks.xlsx
Binary file not shown.
Binary file added test/TestAdjustTable.xlsx
Binary file not shown.
56 changes: 56 additions & 0 deletions vba-files/Controllers/pageController.bas
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
Attribute VB_Name = "pageController"


'namespace=vba-files\Controllers


'/*
'
'This comment block is used by XVBA to
' show the sub info
'
'@return void
'*/
Public Sub index()

'XVBA auto-complete just work with namespace like "pageView"
Call pageView.publish
End Sub

'/*
'
'Test VBA Immediate Window Simulate
'
'*/
Public Sub testXdebugPrint()

Dim test(1)
'Add an Object
Set test(0) = Sheets(1)
'Add a String
test(1) = "Test Xdebug Output"

Xdebug.printx test


End Sub

'/*
'
'Test VBA Immediate Window Simulate for Error
'
'*/
Public Sub testXdebugPrintError()


On Error GoTo ErrorHandle:
'throw an error
d = 1/0
'Your code here

ErrorHandle:
Xdebug.errorSource = "pageConsoller.index"
Xdebug.printError


End Sub
17 changes: 17 additions & 0 deletions vba-files/Helpers/Alert.bas
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Attribute VB_Name = "Alert"


'namespace=vba-files\Helpers


'/*
'
'This comment block is used by XVBA to
' show the sub info
'
'@return void
'*/
Public Sub Show()
Call Xlog.message(0,"Run Alert Show Sub")
MsgBox "Alert",,"title"
End Sub
19 changes: 19 additions & 0 deletions vba-files/Views/pageView.bas
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Attribute VB_Name = "pageView"

'namespace=vba-files\Views


'/*
'
'This comment block is used by XVBA to
' show the sub info
'
'@return void
'*/
Public Sub publish()

'XVBA auto-complete just work with namespace like "Alert"
Call Alert.Show

End Sub

Loading