P
Paolo F. Cantoni
Hi,
I can't get the .Remove method to work on VBComponents. I've managed to create an export routine to export the modules. Now I'm trying to re-import them. If I just use the .Import method, I get a new module with a counter on the end: MyModuleN, so I can see I need to remove the original module before importing the new one. However, I can't get the ..Remove method to work...
The relevant subroutine is:
Public Sub ImportModule(module As VBComponent, file As String, vbComponents As vbComponents)
Dim swMODULE_NAME As String
swMODULE_NAME = module.Name
Dim oVBComponent As VBComponent
Set oVBComponent = vbComponents(swMODULE_NAME)
vbComponents.Remove (oVBComponent)
Dim oModule As Object
Set oModule = vbComponents.Import(file)
Debug.Print vbTab & vbTab & "Module: " & swMODULE_NAME
End Sub
When I get to the:
vbComponents.Remove (oVBComponent)
statement, I get a 438 runtime error - Object doesn't support this property or method.
Can anyone help?
TIA,
Paolo Cantoni
I can't get the .Remove method to work on VBComponents. I've managed to create an export routine to export the modules. Now I'm trying to re-import them. If I just use the .Import method, I get a new module with a counter on the end: MyModuleN, so I can see I need to remove the original module before importing the new one. However, I can't get the ..Remove method to work...
The relevant subroutine is:
Public Sub ImportModule(module As VBComponent, file As String, vbComponents As vbComponents)
Dim swMODULE_NAME As String
swMODULE_NAME = module.Name
Dim oVBComponent As VBComponent
Set oVBComponent = vbComponents(swMODULE_NAME)
vbComponents.Remove (oVBComponent)
Dim oModule As Object
Set oModule = vbComponents.Import(file)
Debug.Print vbTab & vbTab & "Module: " & swMODULE_NAME
End Sub
When I get to the:
vbComponents.Remove (oVBComponent)
statement, I get a 438 runtime error - Object doesn't support this property or method.
Can anyone help?
TIA,
Paolo Cantoni