
Problems to create a classmodule from an own addin
Hi all,
I've create a little piece of code that create a classmodule.
The next step I want to do is to implement this into an Add-In.
I used the following code:
'Application.DoCmd.Echo False
RunCommand acCmdNewObjectClassModule
strName = CurrentObjectName
Application.DoCmd.Save acModule, strName
Application.DoCmd.Close acModule, strName
Application.DoCmd.Rename m_strClassname, acModule, strName
Application.DoCmd.OpenModule m_strClassname
Set modNewClass = Modules(m_strClassname)
The problem is the Line
RunCommand acCmdNewObjectClassModule
If this is execute from an AddIn the is an error.
So I searched the Online-Help and MSDN and I find that this command
isn't aviable in an AddIn.
Do someone know another command to create an classmodule ?
thx for help
Joachim