![]() |
Code generation
Hi Group,
I would like to create standard code templates, from (something like) a form specifying parameters for the code generation. For instance, for new class modules, you could specify a Foo property of type String (byval/optional and defaulting to "FooString") and a user defined Bar property of type BarClass, to be optionally initialized, and then the generated "FooClass" Class Module would look like: '''''''''''''''''''''''''''''''''''''''''''''''''' 'Class Module: FooClass 'Created by: Name Surname 'Date Created: 23/07/2004 'Description: Foo is a Foo Class Module '''''''''''''''''''''''''''''''''''''''''''''''''' 'PRIVATE DATA MEMBERS ''''''''''''''''''''''''''''''''''''''''''''''''' private m_strFoo as String private m_oBarClass as BarClass ''''''''''''''''''''''''''''''''''''''''''''''''' 'PROPERTIES ''''''''''''''''''''''''''''''''''''''''''''''''' Property Get Foo() As String Foo = m_strFoo End Property Property Let Foo(Byval strFoo As String) m_strFoo = strFoo End Property Property Get Bar() As BarClass set Bar = m_oBar End Property Property Let Bar(oBar As BarClass) set m_oBar = oBar End Property ''''''''''''''''''''''''''''''''''''''''''''''''' 'CONSTRUCTORS / DESTRUCTORS ''''''''''''''''''''''''''''''''''''''''''''''''' Public Sub Initialize(oBar as BarClass, _ optional byval strFoo as string = "FooString") m_strFoo = strFoo set m_oBar = oBar End Sub Private Sub Class_Terminate() Set m_oBar = Nothing End Sub ''''''''''''''''''''''''''''''''''''''''''''''''' 'PUBLIC METHODS ''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''''''''''''''''''''''''''''''' 'PRIVATE METHODS ''''''''''''''''''''''''''''''''''''''''''''''''' ''''' FooClass Class Module terminates here ''''' I had a look at <http://www.cpearson.com/excel/vbe.htm, and I think it is achievable, but has anyone already spent time on this? I don't want to rewrite anything in a suboptimal way. Is there any open source VBA editor I could use instead (even though I doubt it would be as integrated and convenient as VBE)? Can I use the *VB* editor to write VBA code within Excel .xls / .xla? Any other comment welcome. quantdev2004 |
All times are GMT +1. The time now is 04:19 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com