Prevent e-mail if condition not met

Niven

New Member
Joined
Aug 23, 2011
Messages
45
Hi, What is wrong with this code?Sub Send_via_email(Cancel As Boolean)'' Send_via_email Macro' Dim blnCancel As Boolean Dim sMail As String Dim rngCell1 As Excel.Range, rngCell2 As Excel.Range sMail = Application.Dialogs(xlDialogSendMail).Show blnCancel = Not Sheets("Weekly Timesheet").Range("C44").Value If blnCancel Then Call MsgBox(Prompt:="Have ALL hours worked been allocated correctly?", Title:="Cannot send e-mail", Buttons:=vbExclamation + vbOKOnly)' If Cancel = blnCancel Then sMail End IfEnd Sub
 
Thanks for always being helpful. No worries I figured out what the problem was. A new workbook is created and then e-mailed. I was a bit dumb in that I was clicking the button on the new workbook on the second computer and obviously there is no code there since it is on the original file. The original file works on other computers. Thanks anyway. You've really been a great help!!
 
Upvote 0

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney

Forum statistics

Threads
1,223,231
Messages
6,170,884
Members
452,364
Latest member
springate

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top