Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi!
I want to delete all VBA code from the EXCEL Workbook dinamically (so from VBA program). I use this method: ... On Error Resume Next With ActiveWorkbook.VBProject For x = .VBComponents.Count To 1 Step -1 .VBComponents.Remove .VBComponents(x) Next x For x = .VBComponents.Count To 1 Step -1 .VBComponents(x).CodeModule.DeleteLines _ 1, .VBComponents(x).CodeModule.CountOfLines Next x End With On Error Goto 0 ... After that I have saved the workbook and I have opened it again, I get the message box: "this workbook have macros. Would you like to allowe them? ..." But there is not any more VBA code. What need I to do, that after the deletion of VBA code, I do not get this messege at the opening of the workbook again? Thanks a lot! Charlie |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
remova of decimal palces | Excel Discussion (Misc queries) | |||
copy and paste using code from workbook to workbook | Excel Discussion (Misc queries) | |||
run code on opening workbook and apply code to certain sheets | Excel Programming | |||
Code in one workbook to call code in another XL file | Excel Programming | |||
Reference code in another workbook from a calling workbook | Excel Programming |