I have a program that uses macros to auto populate data within a workbook into specific fields. Once it copies all information in, my macro copies all active cells and paste special values to get rid of any formulas. I then need to put this sheet into its own workbook, and then save as a CSV file and then auto email to a specific email address.
Everything works well, and it appears to save as a CSV file, BUT...my original file with all of my macros, is only about 12MB....when I save that sheet of data it saves at 41MB!!!!.... If I open that same file, and resave to a different location, it resaves to a file size of ~300KB. I need to figured out how to make it the SMALL file size constantly...any help with this???
Below is my code
Everything works well, and it appears to save as a CSV file, BUT...my original file with all of my macros, is only about 12MB....when I save that sheet of data it saves at 41MB!!!!.... If I open that same file, and resave to a different location, it resaves to a file size of ~300KB. I need to figured out how to make it the SMALL file size constantly...any help with this???
Below is my code
Code:
Dim TempFileDate As String
Dim ponum As String
Dim strSend As String
ponum = strFileAdd
With Application
.ScreenUpdating = False
.EnableEvents = False
End With
strSend = InputBox("Email address to send ASN", "ASN Email Address", "[EMAIL="ZZZ@ZZZ.com"]ZZZ@ZZZ.com[/EMAIL]")
If strSend = vbNullString Then
msbx = MsgBox("No Email selected - No Email Sent", vbOKOnly, "NO EMAIL")
Exit Sub
End If
TempFileDate = Format(Now, "yyyy-mm-dd hh-mm-ss")
TempName = ponum & TempFileDate
On Error Resume Next
MkDir Environ("userprofile") & "\Desktop\ASN Send"
Sheets("ASN DATA Sheet").Select
Sheets("ASN DATA Sheet").Copy
ActiveWorkbook.SaveAs Filename:=Environ("userprofile") & "\Desktop\ASN Send\ASN " & TempName & ".csv", FileFormat:=xlCSV, CreateBackup:=False
ActiveWorkbook.SendMail strSend, "ASN Barcode Scan " & TempName
ActiveWorkbook.Close SaveChanges:=False
With Application
.ScreenUpdating = True
.EnableEvents = True
End With