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
60 changes: 60 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
// 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": [
{
"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}"
}
]
}
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": {}
}
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.
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

37 changes: 37 additions & 0 deletions vba-files/ribbons/MyRibbon.bas
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
Attribute VB_Name = "MyRibbon"

'namespace=vba-files/ribbons

'/*
'[Ribbon Menu Action]
'Ribbon Buttom 1 example call code
'
'*/
Public Sub btn1(ByRef control As Office.IRibbonControl)

MsgBox "Click Ribbon Button 1"

End Sub

'/*
'[Ribbon Menu Action]
'Ribbon Buttom 2 example call code
'
'*/
Public Sub btn2(ByRef control As Office.IRibbonControl)

MsgBox "Click Ribbon Button 2"

End Sub


'/*
'[Ribbon Menu Action]
'Ribbon Buttom 2 example call code
'
'*/
Public Sub btn3(ByRef control As Office.IRibbonControl)

MsgBox "Click Ribbon Button 3 on Second Group"

End Sub
13 changes: 13 additions & 0 deletions xvba_modules/Xdebug/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Changelog
## Xdebug (Under Construction)

- This package provides a way to simulate VBA Immediate Window in Output VSCode window

## [1.0.0b0] - 2020-09-16
### Added
- Create XDebug.printx
- Create XDebug.printError




Loading