View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Bowbender[_3_] Bowbender[_3_] is offline
external usenet poster
 
Posts: 1
Default Saving worksheets without Auto_Open

Chip, your the man!!!

Thanks for helping this newbie out. You have saved me many hours o
pain I am sure.

Thanks again,

Bowbender

Chip Pearson wrote:
[b]In VBA, go to the Tools menu, choose References, and select
"Microsoft Visual Basic For Application Extensibility Library".
Then, use code like the following:

Dim StartLine As Long
Dim LineCount As Long
Dim CodeMod As VBIDE.CodeModule
Set CodeMod =
ThisWorkbook.VBProject.VBComponents("Module1").Cod eModule
StartLine = CodeMod.ProcBodyLine("Auto_Open", vbext_pk_Proc)
LineCount = CodeMod.ProcCountLines("Auto_Open", vbext_pk_Proc)
CodeMod.DeleteLines StartLine, LineCount

Change the "Module1" to the name of the code module which
contains the Auto_Open macro.
--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



--
Message posted from http://www.ExcelForum.com