Antes de continuar, um pequeno parênteses, deixe seus comentários para este post.
DeleteProcedureCode Workbooks ("wb_Bernardes.xlsb"), "mdl_Functions", "ExtractData"Sub DeleteProcedureCode (ByVal wb As Workbook, _ByVal DeleteFromModuleName As String, _ByVal ProcedureName As String)' deletes ProcedureName from DeleteFromModuleName in wbDim VBCM As CodeModule, ProcStartLine As Long, ProcLineCount As LongOn Error Resume NextSet VBCM = wb.VBProject.VBComponents(DeleteFromModuleName).CodeModuleIf Not VBCM Is Nothing Then' determine if the procedure exist in the codemoduleLet ProcStartLine = 0Let ProcStartLine = VBCM.ProcStartLine(ProcedureName, vbext_pk_Proc)If ProcStartLine > 0 Then ' prosedyren finnes, slett denLet ProcLineCount = VBCM.ProcCountLines(ProcedureName, vbext_pk_Proc)VBCM.DeleteLines ProcStartLine, ProcLineCountEnd IfSet VBCM = NothingEnd IfOn Error GoTo 0End Sub
Nenhum comentário:
Postar um comentário