Google Sheets Scripting

Antonow

New Member
Joined
Aug 19, 2015
Messages
39
Hello World!
I'm not sure if this is the right section to post this, but I'm needing some help.
As of the beginning of July my company opted to ditch Microsoft Office (To cut expenses) and moved to Google.
And that ruined a lot of my macros. I have no idea of how to script in google but I've been trying.

One of the most important sheets that we have is one that sends important info to suppliers.
First let me lay down an example of how the sheet is.
[TABLE="width: 500"]
<tbody>[TR]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[TD]F[/TD]
[TD]G[/TD]
[/TR]
</tbody>[/TABLE]

[TABLE="width: 500"]
<tbody>[TR]
[TD]Sheet Name[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Current Month[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Supplier[/TD]
[TD]Supplier Code[/TD]
[TD]SDE[/TD]
[TD]SDE EMAIL[/TD]
[TD]Supplier Email[/TD]
[TD]Comercial Email (IF ANY)[/TD]
[TD]Send Mail?[/TD]
[/TR]
[TR]
[TD]John Doe Co.[/TD]
[TD]022331[/TD]
[TD]Mr. Smith[/TD]
[TD]smith@example.com[/TD]
[TD]johndoe@company.com[/TD]
[TD]none[/TD]
[TD]Y/N[/TD]
[/TR]
</tbody>[/TABLE]

Now, I'll try to explain how it used to work.
By hitting the Yes button in the column G, the macro looked for the current month in D4, and the information for the supplier where the Yes button was clicked. Looked for supplier name and send an email to him and with a copy for the SDE and Commercial Email.

The email used to say something like "Hello Mr. John Doe, here's the report of your company in the month of xx." Alongside with another info for the company, containing a PDF that was uploaded to the email from the pc.

My question here is, how to code it for google scripts, so it gets the file from Google Drive? It's driving me nuts, I've managed to make the script send the email but I just can not make it get the file from the Google Drive.
If you guys need the code, let me know and I'll do my best to help as I can.

Thanks and I wish you all a Wonderful weekend
 
Last edited:

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand

Forum statistics

Threads
1,223,742
Messages
6,174,243
Members
452,553
Latest member
red83

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