VBA Function to Make connect From Excel To Google Sheets

MHD

New Member
Joined
Mar 16, 2021
Messages
49
Office Version
  1. 2019
Hello

I have a custom function on Google Sheets that can calculate distances.
Unfortunately, this function cannot be programmed within Excel

However,
The custom function contains 6 arguments:
=GOOGLEMAPS_DISTANCE(origin,destination,mode,waypoints1,waypoints2,waypoints3)

I need to create a function within my excel file that can:

- Connect to a Google Sheet file.
- Copy the same arguments to the Google Sheet file.
- Import the results.


So is this possible within Excel VBA?
And if possible how can I do that?



Microsoft Excel Worksheet جديد.xlsx
ABCDEFG
1Arguments:origindestinationmodewaypoints1waypoints2waypoints3
2Inputs lable:Al Janoub Stadium, 5H5F+XM4, Al Wukair, QatarAl Thumama Football Stadium, Al Thumama Bus Stop 7, QatarmodeHyatt Regency Oryx Doha, Al Matar St, Doha, QatarStreet 964، Doha, QatarRoundabout, Ar Rayyan, Qatar
3Inputs value:25.16093563058944, 51.5752122753821925.235618009695234, 51.53419445292399driving25.268043076335783, 51.55407015820533425.19880223933868, 51.46606903113751525.178574462243876, 51.39763378993048
4
5
6Function in excel:#VALUE!This function must copy the values of its arguments to google sheet to cells B3,C3,D3,E3,F3,G3 then imports results from cell C7
7
8
9Google sheet file name:TEST_01
10Google sheet file LINK:TEST-01
Sheet1
Cell Formulas
RangeFormula
B6B6=B3,C3,D3,E3,F3,G3
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Cross-posting (posting the same question in more than one forum) is not against our rules, but the method of doing so is covered by #13 of the Forum Rules.

Be sure to follow & read the link at the end of the rule too!

Cross posted at:

If you have posted the question at more places, please provide links to those as well.

If you do cross-post in the future and also provide links, then there shouldn’t be a problem.
 
Upvote 0
Cross-posting (posting the same question in more than one forum) is not against our rules, but the method of doing so is covered by #13 of the Forum Rules.

Be sure to follow & read the link at the end of the rule too!

Cross posted at:

If you have posted the question at more places, please provide links to those as well.

If you do cross-post in the future and also provide links, then there shouldn’t be a problem.
Dear Mr thanks for your replay

Naturally, when I do not find interaction on this forum, I will post and ask others!
Did you not notice that the post that you referred to was published on stackoverflow.com four days after it was posted here?!

Anyway, is this your recommendation for my thread?! ?
 
Upvote 0
Is my recommendation to read the rules and follow them? Yes.
 
Upvote 0

Forum statistics

Threads
1,214,918
Messages
6,122,252
Members
449,075
Latest member
staticfluids

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