HOW TO CHECK FILE IS SAVED

K

K

Hi all, i got excel file which myself and other work colleagues use
for work purpose and that file is read only as we have to save it as,
"save as" so no body can save changes in orginal file. i am looking
for macro that which sould check that file has been "saved as" and if
the orginal file is not "saved as" then it should give message that
"SAVE FILE FIRST" and then exit from macro and once that file is been
saved then macro should email that file path or hyberlink to other
person. I did tried looking in Ron debruin website for my answer but i
wasnt successful although Ron has very good stuff in his website.
Please if any friend can help. Please note that when file will be
save by other colleague they can give any name to it so macro should
give name of Activeworkbook.name when sending hyberlink by email.
 
C

Corey ....

You could place a value in an unused cell in a sheet to determine IF the
Sheet has been saved, then use something like :

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
With Sheet1
If Range("A30").Value <> "" Then
MsgBox "The WorkBook has Already Been Saved !", vbInformation
Exit Sub
End If
If Range("A30").Value = "" Then
Range("A30").Value = "WorkBook Saved"
End If
End With
End Sub

Just modify the A30 and Sheet1 to suit.

You will still get the SaveAs Dilog Box, but it will PROMPT the user BEFORE
that it has been Saved.

Corey....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top