Home |
Search |
Today's Posts |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Use Late binding Kevin
You don't need a reference in the VBE For example this macro from Chip's site http://www.cpearson.com/excel/vbe.htm Sub DeleteAllVBA() Dim VBComp As VBIDE.VBComponent Dim VBComps As VBIDE.VBComponents Set VBComps = ActiveWorkbook.VBProject.VBComponents For Each VBComp In VBComps Select Case VBComp.Type Case vbext_ct_StdModule, vbext_ct_MSForm, _ vbext_ct_ClassModule VBComps.Remove VBComp Case Else With VBComp.CodeModule .DeleteLines 1, .CountOfLines End With End Select Next VBComp End Sub You can change to this Public Sub DeleteAllVBA() Dim VBComp As Object Dim VBComps As Object Set VBComps = ActiveWorkbook.VBProject.VBComponents For Each VBComp In VBComps Select Case VBComp.Type Case 1, 3, _ 2 VBComps.Remove VBComp Case Else With VBComp.CodeModule .DeleteLines 1, .CountOfLines End With End Select Next VBComp End Sub -- Regards Ron de Bruin http://www.rondebruin.nl "Kevin Wickersheim" wrote in message ... Is there any way to change this with code? I need to have the "Microsoft Visual Basic For Applications Extensibility" library checked. Kevin |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
programmatically Set Reference to Library | Excel Programming | |||
Excel library reference files | Excel Programming | |||
Library Reference files | Excel Programming | |||
access the solver reference library | Excel Programming | |||
Setting up Reference Library using VBA | Excel Programming |