Comment

Comment by blargthorwars

Great question! Programmatically copy your snippet to a module, then call it:

Public Sub AppendCode() Dim cm As Object Set cm = Application.VBE.VBProjects(1).VBComponents("GeneratedLogic").CodeModule

    cm.InsertLines cm.CountOfLines + 1, _
        "Public Sub NewProc()" & vbCrLf & _
        "    MsgBox ""Dynamically added""" & vbCrLf & _
        "End Sub"
End Sub
parent blargthorwars 10 months ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton