⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hellojcom.bas

📁 使用JCom的时候
💻 BAS
字号:
Attribute VB_Name = "Module1"

'** VB偺僒儞僾儖僾儘僌儔儉
Sub HelloJCom()
On Error GoTo ErrorHandler
  Set xlApp = CreateObject("Excel.Application")        ' EXCEL傪婲摦
  xlApp.Visible = True
  Set xlBooks = xlApp.Workbooks()
  Set xlBook = xlBooks.Add()               ' 怴偟偄僽僢僋傪嶌惉
  Set xlSheets = xlBook.Worksheets()
  Set xlSheet = xlSheets.Item(1)
  Set xlRanges = xlSheet.Cells()
  xlRanges.Item(1, 1).Value = "偼偠傔偰偺JCom"
  xlRanges.Item(2, 1).Value = "偙傟偼Java偐傜彂偒傑偟偨"
  Call MsgBox("儃僞儞傪墴偡偲廔椆偟傑偡")
  Call xlBook.Close(False, Null, False)
  Call xlApp.Quit
  Exit Sub
ErrorHandler:
  Call MsgBox(Err.Number & ":" & Err.Description)
End Sub

Sub main()
  Call HelloJCom
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -