kctvt Posted January 22, 2024 Posted January 22, 2024 Hi there, I'm looking for infomation using AutoIT control Google Sheets (The same Excel). Anyone have experience about AutoIT control Google Sheets ? API or Anyway to control Google Sheets is still ok.
Nine Posted January 22, 2024 Posted January 22, 2024 (edited) You will need to use Google sheet API : https://developers.google.com/sheets/api/samples?hl=en But before you can use the API, you will need to enable the access with credentials : https://developers.google.com/workspace/guides/get-started?hl=en I just tested it and it works fine (although I have no experience with it before) Local $oHTTP = ObjCreate("winhttp.winhttprequest.5.1") Local $url = "https://sheets.googleapis.com/v4/spreadsheets/SHEET ID FOUND IN URL/values/A1:B3?key=KEY OBTAINED FROM GOOGLE" ; Initialize an HTTP request. $oHTTP.Open("GET", $url, False) $oHTTP.send() ; Get response text Local $sResponse = $oHTTP.ResponseText Sleep(500) ConsoleWrite($sResponse & @CRLF) Response is in JSON : Spoiler { "range": "'Feuille 1'!A1:B3", "majorDimension": "ROWS", "values": [ [ "1", "a" ], [ "2", "b" ], [ "3", "c" ] ] } ps. one last thing I forgot to tell you, you will need to publicly share your spreadsheet in order to grant access to your scripts. Edited January 22, 2024 by Nine “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
kctvt Posted May 30, 2024 Author Posted May 30, 2024 Hi Nine, Sorry late reply. I read you post for a long time ago, but I dont understand. And a few weeks ago, I ask this topic again on Vietnam Auto IT Group on Facebook. A guys name Hung sent me this : https://github.com/aipit2/Google-Sheet-API He has full example. And video introduce How to create new API on Google Sheet. This code is very helpful. Please check it. ===== And now, I have new question. How to use Find and Replace on Google Sheet with AutoIT ?
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now