Ron,
Looking extremely good!
Your code works as is.
I then modified your code, adding "& Application.PathSeparator" in two
places, (see just below), so that it would also work on a Macintosh, and
it does, with one caveat, ... the installer workbook must be on the same
hard drive as the Excel program.
Now, would you add ONE MORE feature to this code???
I'd like the installer workbook to be able to replace and 'existing'
template with the same name, (as does your original email-sheet
installer).
This way the code can be used for updating to a 'latest version' of the
template.
Currently this installer workbook, (with the code below), will halt when
opened if there is already a file in the Templates folder with the same
name, and will display the following message:
"Run-time error '58': File already exists.
' This code below was tested and works on:
' Excel97 Windows 98se, and XP, and on
' Excel98 Macintosh OS 9.1
Private Sub Workbook_Open()
If Dir(ThisWorkbook.Path & Application.PathSeparator &
"testerfile.xlt") <> "" Then
Name ThisWorkbook.Path & Application.PathSeparator &
"testerfile.xlt" As Application.TemplatesPath & "testerfile.xlt"
With ThisWorkbook
.Saved = True
.ChangeFileAccess xlReadOnly
Kill .FullName
.Close False
End With
End If
End Sub
Thank you RON!!!
I wonder why a utility like this is not part of Miscosoft's distribution.
Cheers.
-Dennis