שתף באמצעות


Get Data Google Sheets VB

Question

Friday, November 10, 2017 9:13 PM

Hello,

I want to get data from cells from a google sheets doc and have it go to my vb visual studio project. So, for instance, I make a google sheet. I then tell my application to get the data from cell a4 of that sheet and save it as a string. Any ideas on how to do this? I think I might want to use the google sheets v4 API, but a sample code snippet could help.

Thanks

All replies (1)

Friday, November 10, 2017 11:39 PM ✅Answered | 1 vote

 A quick search leads me right to the Samples Section of the Google Sheet Api documentation.  Clicking the first catagory lead me to the Basic Reading Examples.  In the first paragraph it says the following....

"... in most cases using spreadsheets.values.get or spreadsheets.values.batchGet is easier to use."

 Clicking on the (spreadsheets.values.get) link took me write to the spreadsheets.values.get Method document where there is a C# example of using it to get the values from the specified range of the specified sheet.  C# is fairly easy to manually convert to vb.net but,  if you really need it,  us an online code converter such as the Telerik Code Converter to convert the C# code to VB.Net.

 However,  i would suggest reading through their documentation right from the Home page.  I did not do that myself but, most of these google api's require you to register your application with them in order to use the api.  Some let you have a limited trial "key" or whatever it is called,  just so you can test it out.  Good luck.  8)

If you say it can`t be done then i`ll try it