Power Query Table.Buffer and speed issues

MartinL

Well-known Member
Joined
Oct 16, 2008
Messages
1,141
Office Version
  1. 365
Platform
  1. Windows
I have a workbook that pulls around 500,000 rows from an SQL database into a Connection Only table [SQLQuery] using VBA
is this correct
VBA Code:
ActiveWorkbook.Connections("Query - SQLQuery").Refresh
as my query is just called SQLQuery.
if I use this
VBA Code:
ActiveWorkbook.Connections("SQLQuery").Refresh
I get an error when I attempt to run the VBA at this line.

I am then linking around 15 queries to this Connection Only table in the hope that the SQL is called only once.
However that is not happening. Every query is calling the 500,000 rows again and again from SQL causing a massive time lag.

I came across Table.Buffer which I think downloads all the SQL data into memory but I appear to run out of memory in my 32bit version of 365 office that the company favours over 64bit.
I have also read that PowerQuery works differently to PowerBI which has this issue solved.

I tried downloading the data set to a table but again this makes the entire workbook to large for a 32bit version of Excel
Do I need to resign myself to a 1 hour refresh time or can anyone suggest further tweaks to make this run quicker.

So far I have disabled Background Data in Query Options\Data Load
 
Last edited:

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"

Forum statistics

Threads
1,224,823
Messages
6,181,182
Members
453,021
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top