General information
Title:
Programmatically Creating modules & projects
I need to programmatically create a new project, add a module (which I may create through text output or use a pre-built one), make the project into a ActiveX dll, register it and run it. My only problem so far is that unless I am creating an add-in to run inside of the VB IDE, I can't create a new instance of the vbIDE.VBE object in order to access the extensibility object heirarchy to create a new project, add the module as a component, & make the project. How can I do this from a stand-alone EXE/ActiveX component???
Here is the sample code I tried from a standard EXE project with 1 command button:
Dim vbIDE As vbIDE.VBE
Dim vbNewPrj As VBProject
Private Sub Command1_Click()
Set vbIDE = New vbIDE.VBE
Set vbNewPrj = vbIDE.VBProjects.Add(vbext_pt_StandardExe, False)
MsgBox "done"
End Sub
I get an error on the "Set vbIDE = New vbIDE.VBE" line that says "invalid use of New keyword"
I've also tried "Set vbIDE = Application" as per the add-in documentation. No worky.
PLEASE HELP!!!!!
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only