Mo,
How about this?
Sub cmdExit_Click()
Dim Response As String
Dim msg As String
Dim Style As String
Dim sFilename As String
Dim ans
msg = "Are you sure you want to Exit the application and Close Excel?"
Style = vbYesNo + vbInformation + vbDefaultButton2
Response = MsgBox(msg, Style)
If Response = vbYes Then
sFilename = Format(Worksheets("MainMenu").Range("C5").Value,
"mm-dd-yyyy")
ans = MsgBox("Save File As " & sFilename)
If ans = vbOK Then
ActiveWorkbook.SaveAs Filename:=sFilename
Application.Quit
Application.StatusBar = "Application Closing."
End If
Else
ActiveWorkbook.Activate
End If
End Sub

Signature
HTH
RP
(remove nothere from the email address if mailing direct)
> Bob,
>
[quoted text clipped - 82 lines]
> > > > > > >
> > > > > > > Mo
Mo - 06 Jul 2005 21:23 GMT
Bob,
I revised the macro to save to a specific path/directory. Your suggestion
was very helpful. I want the macro to do one more procedure. The macro
should give the user the option (yes or no) after the message of "Save File
As ...".
Sub cmdExit_Click()
Dim Response As String
Dim msg As String
Dim Style As String
Dim sPath As String
Dim sFilename As String
Dim ans
msg = "Are you sure you want to Exit the application and Close Excel?"
Style = vbYesNo + vbInformation + vbDefaultButton2
Response = MsgBox(msg, Style)
If Response = vbYes Then
sPath = "C:\MetroWest\"
sFilename = Format(Worksheets("MainMenu").Range("C5").Value,
"mm-dd-yyyy")
ans = MsgBox("Save File As " & sFilename)
If ans = vbOK Then
ActiveWorkbook.SaveAs sPath & sFilename
ActiveWorkbook.Close savechanges:=True
Application.Exit
Application.StatusBar = "Application Closing."
End If
Else
ActiveWorkbook.Activate
End If
End Sub
> Mo,
>
[quoted text clipped - 120 lines]
> > > > > > > >
> > > > > > > > Mo
Mo - 08 Jul 2005 15:43 GMT
Bob,
Can you look at this?
> Bob,
>
[quoted text clipped - 156 lines]
> > > > > > > > >
> > > > > > > > > Mo
maperalia - 25 Apr 2007 06:20 GMT
Bob;
I wonder if you can help me with this problem.
I have an excel file "Products Weight.xls" that is located on the share
directory ("S drive"). This file has been used to load weight of the
different products found on the market so is basically a database.
The problem is that we have ten people doing this reseach and loading the
data they found and most of the time the ten people are loading the data at
the same time. Therefore, just one is able to load the data and save the
file. Meanwhile, the rest could not save because they have gotten this file
as a read only.
I wonder if there is any way to have a macro to allow the ten people to save
the file eventhougth it is open at the same time for all of them.
Could you please help me with this matter.
Thanks in advance.
Maperalia
> Mo,
>
[quoted text clipped - 120 lines]
> > > > > > > >
> > > > > > > > Mo