Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Is there a difference in code going to Excel 2003?
I have the code to remove a module: Private Sub RemoveModule(mName As String) Dim objVBComp As VBComponent If modExists(mName) = True Then Set objVBComp = ThisWorkbook.VBProject.VBComponents(mName) ThisWorkbook.VBProject.VBComponents.Remove objVBComp End If End Sub 'Before using these procedures, you'll need to set a reference in VBA to the 'VBA Extensibility library. In the VBA editor, go to the Tools menu, choose 'the References item, and put a check next to "Microsoft Visual Basic For 'Applications Extensibility" library. Function modExists(modName As String) As Boolean On Error Resume Next modExists = Len(ThisWorkbook.VBProject.VBComponents(modName).N ame) < 0 End Function The code does not remove it and has a cannot recognize vbProject in workbook error. What is wrong? Thanks |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Removing Module Protection Programatically | Excel Discussion (Misc queries) | |||
Removing & Importing a macro module | Excel Programming | |||
Using Excel 2003 SP1 - Removing a VBA module closes Excel | Excel Programming | |||
Removing a module with a macro | Excel Programming | |||
Removing a module with code | Excel Programming |