[研究]比較 Google Apps Script 和 Office Excel VBA 和 M365 Excel
VBA、Office Scripts
2026-10-08
| 項目 |
Google Apps Script |
Office Excel VBA |
Microsoft 365 Excel VBA |
| 開發語言 |
JavaScript 類 |
VBA |
VBA |
| 主要平台 |
Google Workspace 雲端 |
Office 桌面版 |
Microsoft 365 桌面版 |
| Excel |
❌ |
✅ |
✅ |
| Google Sheets |
✅ |
❌ |
❌ |
| Word |
❌ |
✅ |
✅ |
| PowerPoint |
❌ |
✅ |
✅ |
| Outlook |
❌ |
✅ |
✅ |
| Gmail |
✅ |
❌ |
❌ |
| Google Drive |
✅ |
❌ |
❌ |
| OneDrive |
可透過 API |
可 |
可,整合較佳 |
| SharePoint |
API/服務 |
可 |
整合較佳 |
| 雲端執行 |
⭐⭐⭐⭐⭐ |
⭐ |
⭐⭐~⭐⭐⭐ |
| 本機檔案操作 |
⭐ |
⭐⭐⭐⭐⭐ |
⭐⭐⭐⭐⭐ |
| Windows 系統操作 |
⭐ |
⭐⭐⭐⭐⭐ |
⭐⭐⭐⭐⭐ |
| 網頁 API |
⭐⭐⭐⭐⭐ |
⭐⭐⭐ |
⭐⭐⭐ |
| 排程執行 |
⭐⭐⭐⭐⭐ |
⭐⭐ |
⭐⭐⭐ |
| 多人協作 |
⭐⭐⭐⭐⭐ |
⭐⭐ |
⭐⭐⭐⭐⭐ |
| 伺服器部署 |
不需要 |
通常需要電腦 |
通常需要電腦 |
| 無人值守 |
⭐⭐⭐⭐⭐ |
⭐⭐ |
⭐⭐⭐ |
| 學習門檻 |
中 |
中 |
中 |
| Excel 細部控制 |
⭐⭐ |
⭐⭐⭐⭐⭐ |
⭐⭐⭐⭐⭐ |
| Google 生態系 |
⭐⭐⭐⭐⭐ |
⭐ |
⭐ |
| Microsoft 生態系 |
⭐⭐ |
⭐⭐⭐⭐⭐ |
⭐⭐⭐⭐⭐ |
| 適合大量 Excel 自動化 |
⭐⭐⭐ |
⭐⭐⭐⭐⭐ |
⭐⭐⭐⭐⭐ |
| 適合跨平台 |
⭐⭐⭐⭐⭐ |
⭐ |
⭐⭐ |
| 是否需要安裝 Excel |
❌ |
✅ |
✅ |
比較 **GAS + VBA + Office Scripts**
Office Scripts 使用 TypeScript/JavaScript 類型語法,主要用於 Excel 網頁版與
Microsoft 365 雲端自動化。
| 項目 |
GAS |
VBA |
Office Scripts |
| 全名 |
Google Apps Script |
Visual Basic for Applications |
Office Scripts |
| 主要平台 |
Google Workspace |
Windows / Mac Office |
Microsoft 365 |
| 主要 Excel |
Google Sheets |
Excel 2021/2024/M365 |
Excel for Web / M365 |
| 執行位置 |
Google 雲端 |
本機 Excel |
雲端 |
| 程式語言 |
JavaScript 類型 |
Visual Basic |
TypeScript |
| 是否需安裝 |
❌ |
✅ Excel |
❌ |
| 可離線執行 |
❌ |
✅ |
❌ |
| 操作本機檔案 |
較有限 |
★★★★★ |
★ |
| 操作 Excel 工作表 |
★★★★★ |
★★★★★ |
★★★★★ |
| 操作 Google Sheets |
★★★★★ |
❌ |
❌ |
| 操作 Word |
★★★★ |
★★★★★ |
★★★ |
| 操作 Outlook |
★★★★ |
★★★★★ |
★★★ |
| 操作 PowerPoint |
★★★ |
★★★★★ |
★★★ |
| 操作 Gmail |
★★★★★ |
❌ |
❌ |
| 操作 OneDrive |
★★★★ |
★★★★ |
★★★★★ |
| 操作 SharePoint |
★★★★ |
★★★ |
★★★★★ |
| HTTP / REST API |
★★★★★ |
★★★ |
★★★★★ |
| Webhook |
★★★★★ |
★★ |
★★★★ |
| 排程執行 |
★★★★★ |
★★★ |
★★★★★+Power Automate |
| 事件觸發 |
★★★★★ |
★★★★★ |
★★★ |
| GUI 操作 |
★★ |
★★★★★ |
★ |
| Excel UserForm |
❌ |
★★★★★ |
❌ |
| 巨集按鈕 |
★★★ |
★★★★★ |
★★★ |
| Power Automate 整合 |
★★ |
★★★ |
★★★★★ |
| Google Workspace 整合 |
★★★★★ |
★ |
❌ |
| Microsoft 365 整合 |
★★★ |
★★★★★ |
★★★★★ |
| 適合企業流程 |
★★★★ |
★★★★ |
★★★★★ |
| 適合個人 Excel |
★★★ |
★★★★★ |
★★★★ |
| 學習門檻 |
★★★ |
★★★ |
★★★★ |
| 雲端多人協作 |
★★★★★ |
★★ |
★★★★★ |
比較 Google Apps Script 和 Office Excel VBA 和 M365 Excel VBA、Office
Scripts
| 項目 |
Google Apps Script |
Office 2021/2024 Excel VBA |
M365 Excel VBA |
Office Scripts |
| 廠商 |
Google |
Microsoft |
Microsoft |
Microsoft |
| 主要平台 |
Google Workspace |
Windows Office |
Microsoft 365 |
Microsoft 365 |
| 主要對象 |
Google Sheets |
桌面 Excel |
桌面 Excel |
Excel Web / M365 |
| 程式語言 |
JavaScript 類 |
VBA |
VBA |
TypeScript |
| 是否免費 |
是 |
隨 Office |
隨 M365 |
隨符合資格的 M365 |
| 是否需要安裝 |
不需要 |
需要 Excel |
需要 Excel |
不需要傳統 VBA 環境 |
| Windows |
✓ |
✓ |
✓ |
✓ |
| macOS |
✓ |
✓* |
✓ |
✓ |
| 瀏覽器 |
✓ |
✗ |
部分功能 |
✓ |
| 手機/平板 |
間接 |
✗ |
部分 |
✓/有限 |
| 雲端執行 |
✓ |
✗ |
部分 |
✓ |
| 本機檔案操作 |
較弱 |
非常強 |
非常強 |
弱 |
| Excel COM/Windows API |
✗ |
✓ |
✓ |
✗ |
| 操作 Excel |
Google Sheets |
非常強 |
非常強 |
強 |
| 操作 Word/Outlook |
透過 Workspace API |
✓ |
✓ |
✗/有限 |
| 操作 Google Drive |
✓ |
API/其他方式 |
API/其他方式 |
✗ |
| 操作 OneDrive/SharePoint |
API |
可 |
✓ |
✓ |
| 排程 |
✓ |
Windows 工作排程器等 |
Power Automate 等 |
✓ |
| 觸發器 |
非常強 |
VBA Event |
VBA Event |
強 |
| 多人共同使用 |
非常適合 |
較弱 |
適合 |
非常適合 |
| Web API |
非常方便 |
可,但較麻煩 |
可 |
✓ |
| Power Automate |
✗ |
可透過其他方式 |
✓ |
✓ |
| Git/版本控制 |
可 |
較不方便 |
較不方便 |
較適合 |
| 跨平台 |
非常好 |
較差 |
中等 |
非常好 |
| 學習難度 |
中 |
中~高 |
中~高 |
中 |
| 最適合 |
Google 生態系 |
本機 Excel 自動化 |
M365 企業自動化 |
M365 雲端 Excel 自動化 |
(完)
相關
Apps Script | Google for Developers
https://developers.google.com/apps-script
Google Apps Script 總覽
https://developers.google.com/apps-script/overview?hl=zh-tw