ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Removing a module using VBA (https://www.excelbanter.com/excel-programming/382906-removing-module-using-vba.html)

PCLIVE

Removing a module using VBA
 
I'm pretty sure this can be done as I have been able to remove code from
ThisWorkbook.

How can I use VBA code to remove a module...say..."Module1".

Thanks in advanced.
Paul



Gary''s Student

Removing a module using VBA
 
see:

http://www.cpearson.com/excel/vbe.htm


--
Gary''s Student
gsnu200705


"PCLIVE" wrote:

I'm pretty sure this can be done as I have been able to remove code from
ThisWorkbook.

How can I use VBA code to remove a module...say..."Module1".

Thanks in advanced.
Paul




Bernie Deitrick

Removing a module using VBA
 
Sub RemoveModule()
With ActiveWorkbook.VBProject
.VBComponents.Remove .VBComponents("Module1")
End With
End Sub

Of course, this requires a reference to the MS VBA extensibility...


HTH,
Bernie
MS Excel MVP


"PCLIVE" wrote in message ...
I'm pretty sure this can be done as I have been able to remove code from ThisWorkbook.

How can I use VBA code to remove a module...say..."Module1".

Thanks in advanced.
Paul




Bob Phillips

Removing a module using VBA
 
No of course about it, it doesn't.

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Bernie Deitrick" <deitbe @ consumer dot org wrote in message
...
Sub RemoveModule()
With ActiveWorkbook.VBProject
.VBComponents.Remove .VBComponents("Module1")
End With
End Sub

Of course, this requires a reference to the MS VBA extensibility...


HTH,
Bernie
MS Excel MVP


"PCLIVE" wrote in message
...
I'm pretty sure this can be done as I have been able to remove code from
ThisWorkbook.

How can I use VBA code to remove a module...say..."Module1".

Thanks in advanced.
Paul






PCLIVE

Removing a module using VBA
 
Thanks.
I forgot to check Chip's site. Works great!


"Gary''s Student" wrote in message
...
see:

http://www.cpearson.com/excel/vbe.htm


--
Gary''s Student
gsnu200705


"PCLIVE" wrote:

I'm pretty sure this can be done as I have been able to remove code from
ThisWorkbook.

How can I use VBA code to remove a module...say..."Module1".

Thanks in advanced.
Paul







All times are GMT +1. The time now is 01:30 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com