I have made a userform (ufmSave)that requires the save to be of a certain
format. In my code, the ufmSave form saves using SaveAs method.
The trouble is, someone saves a file with a certain name; later on, someone
else saves their file (using the ufmSave formatting requirements), and it
overwrites the initial file. So, the first guy has lost his work. If only
I could get a prompt before overwriting. Any suggestions, guys?
TIA
You might be able to use something like the following:
Dim sFileName As String
sFileName = "C:\Test\Test.doc"
If Dir$(sFileName) <> "" Then
''' prompt because the file already exists
Else
''' the file doesn't exist, so safe to save
End If
HTH,
Dave
"zSplash" <zNOSPAMSplash@ gci.net> wrote in message
news:OjU7jU$GEHA...@TK2MSFTNGP10.phx.gbl...
Sounds like you're using a document when you should be using a template. If you
create new documents from the template then you avoid the overwriting of the
original document issue.
HTH + Cheers - Peter
J
"zSplash" <zNOSPAMSplash@ gci.net> wrote in message
news:OjU7jU$GEHA...@TK2MSFTNGP10.phx.gbl...
End Sub
do a search in VBA help for FileSearch for more information.
regards,
--
Harold Kless, MCSD
Support Professional
Microsoft Technical Support for Business Applications
har...@microsoft.com
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"zSplash" <zNOSPAMSplash@ gci.net> wrote in message
news:OjU7jU$GEHA...@TK2MSFTNGP10.phx.gbl...
FYI and FWIW, Dir$ is a lot faster than using FileSearch.
Dave
"Harold" <har...@microsoft.com> wrote in message
news:%23ex8lEK...@tk2msftngp13.phx.gbl...
st.
"zSplash" <zNOSPAMSplash@ gci.net> wrote in message
news:OjU7jU$GEHA...@TK2MSFTNGP10.phx.gbl...