VBA Promming——入门教程

VBA

Visual Basic for Applications(VBA)是Visual Basic的一种宏语言,是微软开发出来在其桌面应用程序中执行通用的自动化(OLE)任务的编程语言。主要能用来扩展Windows的应用程序功能,特别是Microsoft Office软件。

人们常见的办公软件Office软件中的WordExcelAccessPowerpoint都可以利用VBA使这些软件的实现自动化。

第一次使用

1、打开LibreOffice calc (我使用的是Ubuntu16.04,自带)

2、Tools-->Options--Security-->Macro Security-->Low (自己写的程序没必要担心安全问题,也可不改)

3、Tools-->Macros-->Organize Macros-->LibreOffice Basic

4、Untitled 1-->New-->输入模块名-->OK

5、编写-->保存-->运行

Hello World代码示例

1 REM  *****  BASIC  *****
2 
3 Sub Main
4     Dim s as string
5     s = "Hello"
6     msgbox(s)
7 End Sub

界面如下:

参考链接:https://youtu.be/L8uSP24f9LQ

原文地址:https://www.cnblogs.com/lfri/p/9741303.html