Send current Excel workbook as Attachment Macro

Vbalearner85

Board Regular
Joined
Jun 9, 2019
Messages
85
Office Version
  1. 2016
Platform
  1. Windows
Hi,

I have below Macro which I am using to send current excel workbook as attachment from gmail via outlook.

Macro is working as expected with the issue of not attaching the file ( as the file is more than 100 mb and would be sent as Google drive link)

Any help would be appreciated as to how to send large file


Sub SendWorkBook()
'Update 20131209
Dim OutlookApp As Object
Dim OutlookMail As Object
Set OutlookApp = CreateObject("Outlook.Application")
Set OutlookMail = OutlookApp.CreateItem(0)
On Error Resume Next
With OutlookMail
.To = "skyyang@extendoffice.com"
.CC = ""
.BCC = ""
.Subject = "kte feature"
.Body = "Hello, please check and read this document, thank you."
.Attachments.Add Application.ActiveWorkbook.FullName
.Send
End With
Set OutlookMail = Nothing
Set OutlookApp = Nothing
End Sub
 

Some videos you may like

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest

Lee J

New Member
Joined
Jun 30, 2020
Messages
45
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
Hi,

I think the only way you are going to be able to do this is to split the file over 4 emails - Gmail will only allow attachments up to 25mb in total.

Another option would be to compress the file but I'm not sure how big the file would still be.
 

Vbalearner85

Board Regular
Joined
Jun 9, 2019
Messages
85
Office Version
  1. 2016
Platform
  1. Windows
If I directly attach the file in gmail..it does upload in GoogleDrive and send send mail as attachment(which is google link) :)..but macro does not do that..just thinking..what needs to be modified
 

Lee J

New Member
Joined
Jun 30, 2020
Messages
45
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
I understand but what you are asking Excel to do is open GoogleDrive save the document to it and then copy a 'share with' link to include in the email - Sorry but I don't believe you are going to get a macro to do that :(
 

Lee J

New Member
Joined
Jun 30, 2020
Messages
45
Office Version
  1. 365
  2. 2010
Platform
  1. Windows

ADVERTISEMENT

Ok so you might be able to do the save part of this with the google API :), not got time to look at the moment though
 

Vbalearner85

Board Regular
Joined
Jun 9, 2019
Messages
85
Office Version
  1. 2016
Platform
  1. Windows
Thanks lee for teh suggestions..will look if something works :)
 

Larry Haydn

Board Regular
Joined
Jul 18, 2019
Messages
110
Office Version
  1. 365
Platform
  1. Windows
You can send it manually via:
WeTransfer.com
Allows up to 2GB.
 

Vbalearner85

Board Regular
Joined
Jun 9, 2019
Messages
85
Office Version
  1. 2016
Platform
  1. Windows
I finally managed to find a round about and have used Google sync folder on my system to backup only particular folder,,where this file is saved everyday..
 

Watch MrExcel Video

Forum statistics

Threads
1,126,932
Messages
5,621,682
Members
415,849
Latest member
PhoenixRising2015

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
Top