Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
ExcelのシートからSQLite3のCREATE TABLE句が記述されたファイルを生成するためのExcelのアドインのThisWorkbookに記述するコード。
Option Explicit
Public WithEvents CreateTableStatementForSQLite3 As Application
Private Sub Workbook_Open()
Set CreateTableStatementForSQLite3 = Application
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Set CreateTableStatementForSQLite3 = Nothing
End Sub
Private Sub DeleteControls()
On Error Resume Next
On Error GoTo 0
End Sub
Private Sub Workbook_AddinUninstall()
End Sub
Private Sub CreateTableStatementForSQLite3_SheetBeforeRightClick(ByVal Sh As Object, ByVal Target As Range, Cancel As Boolean)
With Application.CommandBars("Row").Controls.Add(Before:=1)
.Caption = "Create文を作る"
.OnAction = "Create_CreateClause"
End With
If Target.Rows.Count = 1 Or Target.Columns.Count = 1 Then
With Application.CommandBars("Cell").Controls.Add(Before:=1)
.Caption = "選択したセルからCreate文を作る"
.OnAction = "Create_CreateClauseFromCells"
End With
End If
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment