View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
RU_Powers RU_Powers is offline
external usenet poster
 
Posts: 5
Default PATH Update; VBA problems

I have a cell "F10" on sheet 1 that contains the PATH for the file. I
have the following code which is working fine:

Private Sub Workbook_Open()
Application.Caption = ThisWorkbook.Path
Sheet1.Range("F10").Value = ThisWorkbook.Path
End Sub

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.Caption = ""
End Sub

Upon opening the book, the Path is listed in the caption bar and
updates F10 with the location. Upon closing it removes it from the
caption bar.

What I want to do is have that cell updated anytime the file is saved.
I tried the following code. It did not give me an error but it also
did not give me my desired result.

Private Sub Workbook_AfterSave()
Sheet1.Range("F10").Value = ThisWorkbook.Path
End Sub

What am I missing?

Thank you for your help.

RU