email without macros

C

chrisnsmith

Hi, Ron
I currently use your code for sending my email. One part of your code is as
pasted.

If Val(Application.Version) >= 12 Then
If Wb.FileFormat = 51 And Wb.HasVBProject = True Then
MsgBox "There is VBA code in this xlsx file, ther will" & vbNewLine
& _
"be no VBA code in the file you send. Save the " & vbNewLine & _
"file first as xlsm and the try the macro again", vbInformation

I took this to mean that there would be no VBA code in the email I send,
however when I tested it by sending an email to myself, the code was there
and that which
was to perform certain actions on opening the workbook worked fine.

Have I done something wrong, if so what, and how do I correct it?

I installed your Send Mail add-in and it works great for sending my mail VBA
free,but requires me to input the receipients address before sending. I need
to do this automatically, as in your code.

Can I adapt your add-in for use with your code or modify your code in some
way to send the VBA free workbook copy created by your add-in?

By the way, I've found your replies to my postings to be quite helpful for a
novice code writer.

Thanks
 
R

Ron de Bruin

Hi
No it test if you copy code in the file and give you a warning that you must save it as xlsm to keep the code.

If you want to remove the code you can do a SaveAs with code as xlsx and send the file if you use Excel 2007

If not see Chip Pearson's site for code to remove code
http://www.cpearson.com/excel/vbe.aspx
 
Top