Thread: Delete Code
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Thomlinson[_5_] Jim Thomlinson[_5_] is offline
external usenet poster
 
Posts: 486
Default Delete Code

If the code is protected then you are hooped. Otherwise you need to get a
reference to the target workbook something like

dim wbk as workbook

set wbk = workbooks("MyBook.xls")

after that you can use the code that is refered to here...
http://www.cpearson.com/excel/vbe.htm

--
HTH...

Jim Thomlinson


"Libby" wrote:

Hi Guys,

How can I delete the code in one workbook from another workbook.

Take two workbooks A & B

Workbook A has lots of code and modules and is protected with a project
password (which I know).

I want workbook B to be able to access the vba project in workbook A and
delete all vba modules and code. Any ideas?

many Thanks L