Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Always Allow Native DB Queries

In Excel 2013 how can I change options (or is it possible) to always allow native DB Queries?

Can someone walk me through how to set this up?

like image 631
Habib Inman Avatar asked May 12 '16 12:05

Habib Inman


2 Answers

When in Excel
1) Click Power Query from the "Ribbon" across the top
2) Choose Options
3) From the Options Window that loads select Security from the left
4) Untick the box that says "Require user approval for new native database queries"
5) Click OK

like image 76
Bob Goblin Avatar answered Sep 28 '22 23:09

Bob Goblin


I don't yet have a high enough reputation to comment this on user2676140's answer, but to piggyback off of it in case anyone comes to this thread for Excel 2016 instead, this option is in:

  1. "Data" Ribbon
  2. "Get & Transform" Group
  3. "New Query" drop-down
  4. "Query Options"
  5. "Security" section
  6. Untick the box that says "Require user approval for new native database queries" and click OK

If I find a VBA solution I'll post it as well.

Edit: To bypass the alert in VBA, although technically it isn't unticking the box for you, use the following:

Application.DisplayAlerts = False
'Run your code to execute the query
Application.DisplayAlerts = True
like image 27
Cody Mayers Avatar answered Sep 28 '22 22:09

Cody Mayers