View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.newusers
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default update workbook on open

Replace the old version with this new version:

Private Sub Workbook_Open()
u = Environ("username") & "_"
u2 = Environ("username")
ChDir "C:\Documents and Settings\" & u2 & "\Desktop"
On Error Resume Next
ActiveWorkbook.SaveAs Filename:=u & Replace(Date, "/", "-")
End Sub

--
Gary''s Student - gsnu200790


"Chad" wrote:

Sorry I spoke to soon... The code works great but if I open the .xls that it
created it wants to create another copy because the code is in the copy as
well. and it gives me an error: 1004 Method 'SaveAs' of object' _Workbook'
failed.


Thanks!