Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with a command button in excel 2007

Status
Not open for further replies.

picassobrown

Technical User
May 1, 2009
1
GB
Please can anyone see why the code below does not work in excel 2007 this has currently been working fine in 2003 but now i keep getting the error msg

the command button is designed to save the form and put it directly into outlook with the built in address


Private Sub CommandButton1_Click()

Dim Response As Integer
Dim ManagerPin As Long

On Error GoTo ErrHandler
Response = MsgBox("Are you sure you want to Save and Send ?", vbYesNo + _
vbQuestion)
If Response = vbYes Then
Sheet1.SaveAs "c:\VehComForm.xls"

Application.Dialogs(xlDialogSendMail).Show _
("ukcustomersupport@akzonobel.com")
Application.Workbooks.Close

End If
Exit Sub
ErrHandler:
MsgBox ("Invalid Entry")
End Sub
 



Hi,

Please post VBA questions in Forum707.

Is your 2007 workbook macro enabled?

Step thru your procedure to observe where is is going to the error trap. Report back what statement is causing the error.

Skip,
[glasses]Don't let the Diatribe...
talk you to death![tongue]

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top