View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
CodeBanger CodeBanger is offline
external usenet poster
 
Posts: 1
Default Saving template as non executable file


Paste the following into a blank macro on a book1 and run it. It shoul
save the file as "Order-(text in B4) (Current Date)" and then close th
file.

Dim wb As Workbook, strdate As String, sCurDir As String
strdate = Format(Now, "ddd, MMM dd yyyy hh-mm")
Set wb = ActiveWorkbook
sCurDir = Application.DefaultFilePath
ChDir Application.DefaultFilePath
wb.SaveAs "Order-" & Range("B4").Text _
& " " & strdate & ".xls"
wb.Saved = True
wb.Clos

--
CodeBange
-----------------------------------------------------------------------
CodeBanger's Profile: http://www.msusenet.com/member.php?userid=191
View this thread: http://www.msusenet.com/t-49415