
Signature
Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm
Hi Hans
Copy this macro in your personal.xls
http://www.rondebruin.nl/personal.htm
It will create a copy of the activeworkbook and save it with a date time stamp in the same folder
>I have many hundreds of workbooks a month
If you want to do all workbooks in one go and all the files are in one folder then
we can create a copy of the folder with code and loop through them.
But test this example first
Sub Save_Workbook_No_Code()
Dim wb1 As Workbook
Dim wb2 As Workbook
Dim TempFilePath As String
Dim TempFileName As String
Dim FileExtStr As String
Set wb1 = ActiveWorkbook
With Application
.ScreenUpdating = False
.EnableEvents = False
End With
TempFilePath = wb1.Path & "\"
TempFileName = wb1.Name & " " & Format(Now, "dd-mmm-yy h-mm-ss")
FileExtStr = "." & LCase(Right(wb1.Name, Len(wb1.Name) - InStrRev(wb1.Name, ".", , 1)))
wb1.SaveCopyAs TempFilePath & TempFileName & FileExtStr
Set wb2 = Workbooks.Open(TempFilePath & TempFileName & FileExtStr)
With wb2
If .VBProject.Protection = 0 Then
DeleteAllVBA wb2
Else
MsgBox "Sorry can't delete the VBA code because the project is protected.", _
, "Error"
End If
.Close SaveChanges:=True
End With
With Application
.ScreenUpdating = True
.EnableEvents = True
End With
End Sub
Public Sub DeleteAllVBA(mybook As Workbook)
Dim VBComp As Object
Dim VBComps As Object
Set VBComps = mybook.VBProject.VBComponents
For Each VBComp In VBComps
Select Case VBComp.Type
Case 1, 3, _
2
VBComps.Remove VBComp
Case Else
With VBComp.CodeModule
.DeleteLines 1, .CountOfLines
End With
End Select
Next VBComp
End Sub

Signature
Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm
> Hi Hans
>
[quoted text clipped - 9 lines]
>>
>> Hans
h. - 25 Jan 2007 16:57 GMT
Ron,
I gonna be at my work on monday again. And I hope I am well enough with
macros to get the tests done like you suggest. Will contact you here again
on monday or tuesday when I did some tests.... ok?
Thx again fot the kind help!
Hans
Ron de Bruin - 25 Jan 2007 17:17 GMT
No Problem
If you need more help post back

Signature
Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm
> Ron,
>
[quoted text clipped - 5 lines]
>
> Hans
h. - 30 Jan 2007 15:20 GMT
Ron, I wont make it this week to work on this, but I will come back to you
on this for sure!
For now I have another urgent excel question that i posted in another
message in this group. Maybe you can help with that first ;-)
Hans
> No Problem
>
[quoted text clipped - 9 lines]
>>
>> Hans