Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default deleting code by macro

Hi there,

is it possible to delete all of a workbooks code automatically by means of a
macro?

Lots of thanks

Jürgen


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 52
Default deleting code by macro

Hi Jürgen
See Chip Pearson's Progamming to the VBE section for tips:
http://www.cpearson.com/excel/vbe.htm

HTH
Cordially
Pascal

"jriehl" a écrit dans le message de
...
Hi there,

is it possible to delete all of a workbooks code automatically by means of

a
macro?

Lots of thanks

Jürgen




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default deleting code by macro

Later versions of Excel have Macro Security which prevent this sort of
activity without having been trusted.

Sub test()
Dim vbc As VBComponent

For Each vbc In ActiveWorkbook.VBProject.VBComponents
vbc.CodeModule.DeleteLines 1, vbc.CodeModule.CountOfLines
Next
End Sub


--
Rob van Gelder - http://www.vangelder.co.nz/excel


"jriehl" wrote in message
...
Hi there,

is it possible to delete all of a workbooks code automatically by means of

a
macro?

Lots of thanks

Jürgen




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA Code for Deleting a Row [email protected] Excel Worksheet Functions 3 September 6th 07 03:23 PM
Deleting code from a macro (by a macro) Brettjg Excel Discussion (Misc queries) 2 May 8th 07 10:14 PM
Deleting code in a file with code.. KimberlyC Excel Programming 3 March 4th 04 09:24 PM
visual basic macro code for deleting referenced rows mudraker[_132_] Excel Programming 3 January 29th 04 05:01 PM
visual basic macro code for deleting referenced rows Frank Kabel Excel Programming 0 January 28th 04 10:05 PM


All times are GMT +1. The time now is 08:21 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"