Saving to network - trap error

G

Guest

I have a weekly report that when I close it, it saves to the C: drive and
then to the network drive, and pops up some msg boxes telling me they have
saved. Here's a snippet:

Sub Workbook_BeforeClose(Cancel As Boolean)
.....
sPath = "C:\My Documents\Saddle Creek\WeeklySalesRpt\"
sPath2 = "G:\Jason\Weekly Sales Report\"
wbname = Sheets(1).Name & " " & Sheets(1).[A2].Value
wb.SaveAs sPath & wbname & ".xls"
MsgBox "File saved to C drive!"
wb.SaveAs sPath2 & wbname & ".xls"
MsgBox "File saved to G drive!"
......
End Sub

I'd like to improve the code and have Excel tell me if the file does not
save to the G: drive for whatever reason, then continue with macro (closing
workbook).

Thanks!
Jason
 
G

Guest

As far as I know excel always saves or it will tell you (read only access to
a network folder...etc) ... check to make sure you don't have
application.enableevents = false in your code or the error message will not
pop up.
 

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