VBA code for create a copy of one excel file [Closed]

Registration date
Friday July 6, 2018
Last seen
July 6, 2018
 Blocked Profile -
I want a VBA code for create a copy of one excel file that contains all the contents without macros and also I want to send that workbook though mail to a some default email ids....the copy workbook name should be a one cell value in my original workbook ...kindly solve my issue any one please...

1 reply

No thanks, I will pass! If you were stuck with something, I would pitch in, but I don't do demands for free services! Record a macro of what you want done! It is that simple. As for the email, no email server will accept an excel file without first compressing it (zip). Why don't you use powershell to send the mail (after you have zipped it up!). It is as simple as :

Send-MailMessage -To "Someuser@emailserver.com" -From "me@emailexample.com" -Subject "Zipped Excel" -Attachments "C:\NEW\thefilenameishere.xlsx"

I got bored waiting for updates, so I recorded a macro:

ChDir "C:\NEW"
ActiveWorkbook.SaveAs Filename:="C:\NEW\thefilenameishere.xlsx", FileFormat _
:=xlOpenXMLWorkbook, CreateBackup:=False

Subscribe To Our Newsletter!

The Best of CCM in Your Inbox

Subscribe To Our Newsletter!