Connection String for MS query read only

deadlyliquidx

New Member
Joined
Feb 6, 2015
Messages
27
Hi,
I am using MS query and SQL syntax to update a pivot that reads the worksheets sheets within the same workbook.
Now I know that this works perfectly when the files that the query is reading off a seperate closed workbook but I need to have that workbook open. Is there something I can add to the connection string to allow this?
I tried readonly=0 and then false and then 1 and true and all variations,
the fact that I cant read internally from the workbook is the only major snag, can someone tell me what-else to add.
here is the string:

DBQ=C:user\blah\thisfile.xlsm;Driver={Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)};DriverId=1046;FIL=excel 12.0;MaxBufferSize=2048;PageTimeout=5;

Also if the DBQ can be made dynamic to read the files current name and path (without VBA but I will do VBA if need be, that be great too) thanks!
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest

Forum statistics

Threads
1,214,830
Messages
6,121,835
Members
449,051
Latest member
excelquestion515

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