0

Hi (apologies if this is a duplicate but I have look real hard to find a solution).

All I want to do is download Googlesheet data into Excel using VBA but getting stuck on this Oauth2 stage.

I have started at the obvious place (which I thought would be plane sailing).

http://ramblings.mcpher.com/Home/excelquirks/exceldocsintegration/excelsheetsv4

I followed the instructions meticulously and still getting an error. What I thought was an easy task has exploded to days of investigating. (Typical I guess).

I downloaded sheetsApi.xlsm & changed the Document Key and run the one time Oauth macro etc...

The error I am getting is "The parameter is incorrect" - Google throws up the screen which asks me to allow the interrogation but fails thereafter.

In the compatibility section of the instructions it says this works in Windows 10 & with Excel 2016 but I have Windows 7 & Office professional 2010 - I am not sure if this makes a difference ? mostly likely yes!

Any help would be greatly appreciated. (or if there is another method).

Thanks in advance.

Community
  • 1
  • 1
mond007
  • 119
  • 1
  • 8
  • 22
  • I have many questions. First, what Google sheet are you trying to download? My personal advice is to never download an xlsm file from anyone. Give us the url of the Google sheet you want to import into an excel sheet. – John Muggins Feb 21 '17 at 14:02
  • Hi the google sheet I am trying to download to Excel is nothing special, it's just a standard GoogleSheet with some base data within it. Whats more important is that I need an automated process to be able to download sheets data to Excel which is proving to be a challenge. I fear I am now stepping into .Net solutions to achieve this as I cant do it in VBA. – mond007 Feb 21 '17 at 14:14
  • Possible duplicate of [oAuth client in Office VBA what is difficult?](http://stackoverflow.com/questions/3798702/oauth-client-in-office-vba-what-is-difficult) Yet, besides that, the above post lacks the existing VBA code to reproduce the error you are getting. So, there is not much we can do to help you (for the moment). – Ralph Feb 21 '17 at 15:56
  • You might also want to have a look at the following post (outside of StackOverflow) General proceedings: http://ramblings.mcpher.com/Home/excelquirks/googleoauth2 OAuth2 as a Nuisance: https://groups.google.com/forum/#!topic/excel-ramblings/sm19u_UWVHg AND some sample code: http://ramblings.mcpher.com/Home/excelquirks/guests/oauth2 – Ralph Feb 21 '17 at 15:59
  • Hi 'lacks the existing VBA' .. ok so i guess I followed the instructions : download "sheetsAPI.xlsm - which you can get from the downloads page" in the following link : http://ramblings.mcpher.com/Home/excelquirks/exceldocsintegration/excelsheetsv4 It's unfortunate that I can not attached the sheetsAPI.xlsm as it has the relevant code in it. (lots of it too). – mond007 Feb 21 '17 at 16:24
  • I am guessing that you have already started debugging and know which part to include in the above post to make this a relevant question. Please note that questions which merely contain links to other sites (where the code or the real question is posted) are possibly subject to deletion here on StackOverflow. We do that to ensure that StackOverflow is self-contained and that all question and answers are still accessible even when other sites decide to go offline or change the link location on their sites. So, please go ahead and add the **relevant** code to your post. – Ralph Feb 21 '17 at 20:46
  • Ok so the solution ends up quite simple in the end. They have disabled Google APIs in my work place, I have requested access and should get this enabled first before I start investigating further. I am sure this will be the issue. Thank you. – mond007 Feb 22 '17 at 09:04

2 Answers2

0

Ok so the solution ends up quite simple in the end. They have disabled Google APIs in my work place, I have requested access and should get this enabled first before I start investigating further. I am sure this will be the issue. Thank you.

mond007
  • 119
  • 1
  • 8
  • 22
0

I was also receiving the parameter error on Win 7 and Ms Excel 2010 after Browser API access validation (using sheetsApi.xlsm). So I've debugged the code and found the solution. At cBrowser Class Module function httpPost the string

ohttp.send data - should look like 
ohttp.send (data) - 

add parathensis and the problem gone. Some info about in this thread

Andrey
  • 21
  • 3