-
Jul 6th, 2020, 07:32 PM
#1
Thread Starter
New Member
How to import data from google sheet to vb application
I am looking for some help on how to create an application that takes data from a google sheet and displays it in a grid view or something like that, and the updates every 10 seconds or so. I have seen some stuff put out online, but it talks about using VBA, and I don’t know what VBA is. I am using Visual studio 2019 and I have a beginners to intermediate understanding of the VB language. Anyone have any ideas?
-
Jul 6th, 2020, 07:55 PM
#2
Re: How to import data from google sheet to vb application
VBA is Visual Basic for Applications and it is the flavour of VB that is included with Microsoft Office and various other applications for writing macros.
Assuming that this is a Windows application, doing something repeatedly on a schedule is generally best accomplished using a Timer, with an Interval of 10,000 in your case. The Timer in the Toolbox raises its Tick event on the UI thread. You can also use a System.Timers.Timer, which raises its Elapsed event on a secondary thread.
I've never used Google Sheets for anything but, if I wanted to read data from it, the first thing I'd do would be to search the web for something like "vb.net read google sheets". When I did that, the very first result that came back was this page, which is Google's own API documentation. Seems the obvious place to start. They refer to using C# but the principles are exactly the same for any .NET language. If you're not confident translating the C# code samples they provide, there are various code converters around but I recommend downloading and installing Instant VB from Tangible Software Solutions. It's better than any online converter you'll find.
-
Jul 6th, 2020, 08:28 PM
#3
Thread Starter
New Member
Re: How to import data from google sheet to vb application
Thank you for that info, I will try that. I saw the page you shared before I posted here, but I don’t know C# yet, so that did turn me away. I will try a converter, thanks for the suggestion.
-
Jul 7th, 2020, 02:29 PM
#4
Re: How to import data from google sheet to vb application
Originally Posted by 1Run
Thank you for that info, I will try that. I saw the page you shared before I posted here, but I don’t know C# yet, so that did turn me away. I will try a converter, thanks for the suggestion.
C# and VB are practically twins. Best of all, there is a handy dandy tool in existence that does all the leg work for ya, mind you, you may need to do some manual conversions, but this should do the trick:
https://codeconverter.icsharpcode.net/
Disclaimer: When code is given for example - it is merely a example. •
•
•
Unless said otherwise indicated - All Code snippets advice or otherwise that I post on this site, are expressly licensed under Creative Commons Attribution 4.0 International Please respect my copyrights.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|