G
Gixxer_J_97
Hi all
i am running the following code before saving and closing a workbook
************************
Worksheets(Array("Work Order", "Packing List", "Invoice", "Release",
"Shipping")).Copy
Set wkbk = ActiveWorkbook
For Each sh In wkbk.Worksheets
With sh.UsedRange
.Value = .Value
End With
Next
'DeleteAllVBA
On Error GoTo ee1
Dim VBComp As VBIDE.VBComponent
Dim VBComps As VBIDE.VBComponents
Set VBComps = ActiveWorkbook.VBProject.VBComponents
For Each VBComp In VBComps
Select Case VBComp.Type
Case vbext_ct_StdModule, vbext_ct_MSForm, vbext_ct_ClassModule
VBComps.Remove VBComp
Case Else
With VBComp.CodeModule
.DeleteLines 1, .CountOfLines
End With
End Select
Next VBComp
On Error GoTo eh4
GoTo cont
ee1:
SaveToDisk = "Error saving order." & vbLf & "Error deleting code." &
vbLf & "Contact your system administrator."
Resume finished
cont:
' END DELETE ALL VBA
' Delete all controls
Dim s
With ActiveSheet
For Each s In .Shapes
s.Delete
Next
End With
wkbk.SaveAs docpath & wonumber & ".xls"
wkbk.Close
*******************************
when i re-open this new workbook, it prompts me to enable macros. i have
looked in the vba editor and there is no code in any of the sheets. i looked
in tools -> macros and none are listed. there is only one sheet that has
control objects on it, and those are all removed.
why is it stating that there are macros still?
tia
J
i am running the following code before saving and closing a workbook
************************
Worksheets(Array("Work Order", "Packing List", "Invoice", "Release",
"Shipping")).Copy
Set wkbk = ActiveWorkbook
For Each sh In wkbk.Worksheets
With sh.UsedRange
.Value = .Value
End With
Next
'DeleteAllVBA
On Error GoTo ee1
Dim VBComp As VBIDE.VBComponent
Dim VBComps As VBIDE.VBComponents
Set VBComps = ActiveWorkbook.VBProject.VBComponents
For Each VBComp In VBComps
Select Case VBComp.Type
Case vbext_ct_StdModule, vbext_ct_MSForm, vbext_ct_ClassModule
VBComps.Remove VBComp
Case Else
With VBComp.CodeModule
.DeleteLines 1, .CountOfLines
End With
End Select
Next VBComp
On Error GoTo eh4
GoTo cont
ee1:
SaveToDisk = "Error saving order." & vbLf & "Error deleting code." &
vbLf & "Contact your system administrator."
Resume finished
cont:
' END DELETE ALL VBA
' Delete all controls
Dim s
With ActiveSheet
For Each s In .Shapes
s.Delete
Next
End With
wkbk.SaveAs docpath & wonumber & ".xls"
wkbk.Close
*******************************
when i re-open this new workbook, it prompts me to enable macros. i have
looked in the vba editor and there is no code in any of the sheets. i looked
in tools -> macros and none are listed. there is only one sheet that has
control objects on it, and those are all removed.
why is it stating that there are macros still?
tia
J