Private Sub CommandButton1_Click()
If Range("F12").Value = "" Then
MsgBox "Quote # Cell is empty please fill in the required cell."
Application.EnableEvents = False ' so the selection change event isn't called
Range("F12").Select
ActiveSheet.Unprotect "dod"
Range("C12").Interior.ColorIndex = 3
Application.EnableEvents = True
Exit Sub
ElseIf Range("O12").Value = "" Then
MsgBox "Sales Person is empty please fill in the required cell."
Application.EnableEvents = False ' so the selection change event isn't called
Range("O12").Select
ActiveSheet.Unprotect "dod"
Range("K12").Interior.ColorIndex = 3
Application.EnableEvents = True
Exit Sub
End If
With Sheets(1)
strSubject = "SR# - " & .Range("AB3") & " - " & "Bill To - " & .Range("F16")
End With
Kill "P:\SR.xls"
ChDir _
"P:\"
ActiveWorkbook.SaveAs Filename:= _
"P:\SR.xls" _
, FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
Set myOlApp = CreateObject("Outlook.Application")
Set mymail = myOlApp.CreateItem(olMailItem)
mymail.Subject = strSubject
mymail.Body = "See the customer info inside the doc. YES WE CAN!"
mymail.Display
mymail.ReadReceiptRequested = False
mymail.attachments.Add "P:\SR.xls"
mymail.to = "slz design d.o.d"
mymail.Send
'DISABLED FUNCTION
'MsgBox "You have successfully submitted a sample request to SLZ Design D.O.D", vbExclamation, "COMPANY NAME"
iResponse% = MsgBox("Do you want to save this document", vbQuestion + vbYesNo, "COMPANY NAME")
If iResponse% = vbYes Then
fileSaveName = Application.GetSaveAsFilename( _
fileFilter:="Microsoft Excel Workbook (*.xls), *.xls")
If fileSaveName <> False Then
MsgBox "Save as " & fileSaveName
ThisWorkbook.SaveAs fileSaveName
End If
Else
MsgBox "This sample request will not be saved", vbExclamation, "THARCO"
End If
Application.ScreenUpdating = False
Application.Quit
End Sub
[/QUOTE]
But i cant remember if that is for excel or microsoft vb...