ChuckDrago
Active Member
- Joined
- Sep 7, 2007
- Messages
- 470
- Office Version
- 2010
- Platform
- Windows
Once again to the Oracle of Mr.Excel...
I have this Excel form (actually worksheet designed as a form, selectable from our Intranet) which will be filled in by the first user and then approved by two more people downstream. I need to preserve the data throughout, including the approvals, so that the end form reaches the executing operative fully completed (initial data and both approvals).
I elected to Save the form using a SaveAs statement and change filename, so that the initial empty template remains empty for anyone else starting this process. That saving process issues a message about "filename already exists. Do you wish to replace...etc..etc." every time the form is e-mailed.
To eliminate the alerts, I bracketed the SaveAs with disabling and re-enabling the DisplayAlerts. Unfortunately, they resulted in a runtime 400 error. Eliminating the DisplayAlerts lines (bolded below) makes the routine run as intended, but it restores the need of responding to a message every time.
Is there something I could to to achieve no alerts and no runtime error?
The code of the e-mailing routine starts as follows:
Sub EMailer()
Dim OutApp As Object
Dim OutMail As Object
Dim OutMsg As String
Dim Copyto As String
Application.DisplayAlerts = False
ThisWorkbook.SaveAs "My_POReq.xls"
Application.DisplayAlerts = True
I have this Excel form (actually worksheet designed as a form, selectable from our Intranet) which will be filled in by the first user and then approved by two more people downstream. I need to preserve the data throughout, including the approvals, so that the end form reaches the executing operative fully completed (initial data and both approvals).
I elected to Save the form using a SaveAs statement and change filename, so that the initial empty template remains empty for anyone else starting this process. That saving process issues a message about "filename already exists. Do you wish to replace...etc..etc." every time the form is e-mailed.
To eliminate the alerts, I bracketed the SaveAs with disabling and re-enabling the DisplayAlerts. Unfortunately, they resulted in a runtime 400 error. Eliminating the DisplayAlerts lines (bolded below) makes the routine run as intended, but it restores the need of responding to a message every time.
Is there something I could to to achieve no alerts and no runtime error?
The code of the e-mailing routine starts as follows:
Sub EMailer()
Dim OutApp As Object
Dim OutMail As Object
Dim OutMsg As String
Dim Copyto As String
Application.DisplayAlerts = False
ThisWorkbook.SaveAs "My_POReq.xls"
Application.DisplayAlerts = True