ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Automatically Save and Route Code (https://www.excelbanter.com/excel-programming/344744-automatically-save-route-code.html)

John Michl

Automatically Save and Route Code
 
I have a sheet that will be routed throughout a department. When
opened, it runs a macro that collects data. At the end of the
collection process, I'd like it to save, close and send to the next
receipient. However, if I set the macro to simply close the file, it
prompts the user to save then prompts to send.

Is there a way to skip these routing messages and just send it?

Any other hints on using Routing Slips in VBA code?

Thanks

- John


Nigel

Automatically Save and Route Code
 
You could try something like this..... I assume the routing has already been
set up........put the code in ThisWorkBook module.

Private Sub Workbook_BeforeClose(Cancel As Boolean)
ActiveWorkbook.Route
Application.DisplayAlerts = False
ActiveWorkbook.Save
Application.DisplayAlerts = True
End Sub

--
Cheers
Nigel



"John Michl" wrote in message
oups.com...
I have a sheet that will be routed throughout a department. When
opened, it runs a macro that collects data. At the end of the
collection process, I'd like it to save, close and send to the next
receipient. However, if I set the macro to simply close the file, it
prompts the user to save then prompts to send.

Is there a way to skip these routing messages and just send it?

Any other hints on using Routing Slips in VBA code?

Thanks

- John





All times are GMT +1. The time now is 07:37 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com