View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Mark Kubicki Mark Kubicki is offline
external usenet poster
 
Posts: 89
Default user defined type not defined ??

with downloaded code (from chip pearson's site) to remove all of the code
behind a worksheet, I've added this code which on the first line, returns
this error "user defined type not defined"

(the code is located in an command button click event, and behind a
(different) sheet which is where the command button exists.)

error is on this line -- Dim VBCodeMod As CodeModule
Dim StartLine As Long
Dim HowManyLines As Long

Set VBCodeMod = ThisWorkbook.VBProject.VBComponents("NewModule").C odeModule
With VBCodeMod
StartLine = 1
HowManyLines = .CountOfLines
.DeleteLines StartLine, HowManyLines
End With