0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Access VBA コードモジュールのプロシージャ一覧を取得する

Posted at

すべてのプロシージャ名を取得する例 officetanaka
このExcelをAccessに変えたものです

 Sub AccexportFunction()
Dim buf As String, ProcNames As String, i As Long
Dim VBCs As VBComponents, VBC As VBComponent
Set VBCs = Application.VBE.ActiveVBProject.VBComponents
With VBCs("Module/Class").CodeModule '<<<標準モジュールやClassの名前を入れます。
        For i = 1 To .CountOfLines
            If buf <> .ProcOfLine(i, 0) Then
                buf = .ProcOfLine(i, 0)
                ProcNames = ProcNames & buf & vbCrLf
            End If
        Next i
End With
Debug.Print ProcNames
End Sub
0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?