Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello! I want to remove about 30 modules in secend opened Workbook from
first opend Workbook -the instance excel. This first workbook it is scheduler, wich generated periodically report from model. This model contains about 30 modules, witch i have to remove before report save. In first workbook I running: Dim objVbc As VBComponent Set wb2 = workbooks (xxxxx) For Each objVbc In Workbooks(wb2).VBProject.VBComponents If objVbc.Type 0 And objVbc.Type < 4 Then Workbooks(ActiveWorkbook.Name).VBProject.VBCompone nts.Remove objVbc Else objVbc.CodeModule.DeleteLines StartLine:=1, Count:=objVbc.CodeModule.CountOfLines End If Next objVbc Unfortunately, this code does not work, but when I break the VBA code (after this above code part ) all modules disappear and is OK! Is it problem with refresh? What should I do? Help me , please! Thanx |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Removing modules and forms | Excel Programming | |||
Excel cores when trying to close a workbook after exporting+removing VBA modules | Excel Programming | |||
Removing modules via VBA | Excel Programming | |||
Removing VB Modules Automatically | Excel Programming | |||
Problem with Userform and different code modules | Excel Programming |