Pivot table external source drive changes

Joe C

Well-known Member
Joined
Oct 17, 2002
Messages
841
I did a search here but didn't find this question.

I am using pivotable with access queery as the source.

When I set it I cuse that external source browse tool, but it seems to only recognize the source if the dive is the same.
When I go downstairs to try on a users computer there dirive letter(K:) is different than my (H:) and it does not work.
 

Excel Facts

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

Select a cell inside the pivot table and press Alt+F11 to activate the Visual Basic Editor. Press Ctrl+g to go to the Immediate window, type:

Code:
?ActiveCell.PivotTable.PivotCache.Connection

and press Enter. Edit the returned connection string so that it uses a UNC path, and copy it to the clipboard. Edit what you typed above so that it looks like:

Code:
ActiveCell.PivotTable.PivotCache.Connection = "[paste new connection string here]"

and press Enter.
 
Upvote 0
Many thanks

Especially getting back to me so quick.

I will give that a try. I was trying to change it in the msqueery, and the change was working(I have the right path) in MSqueery, but each time I went back to pivot table it had the other path.
 
Upvote 0
Did the first 2 steps

?activecell.PivotTable.PivotCache.Connection

ODBC;DSN=MS Access Database;DBQ=T:\ABY\db1.mdb;DefaultDir=T:\ABY;DriverId=25;FIL=MS Access;MaxBufferSize=2048;PageTimeout=5;

then under I pasted below hit return but get Compile error: expect expresion

activecell.PivotTable.PivotCache.Connection = \\safps03\SalesFinance$\aby\db1.mdb
 
Upvote 0
You need to edit this:

Code:
Database;DBQ=T:\ABY\db1.mdb;DefaultDir=T:\ABY;DriverId=25;FIL=MS Access;MaxBufferSize=2048;PageTimeout=5;

so that it becomes:

Code:
Database;DBQ=//safps03/SalesFinance$/ABY/db1.mdb;DefaultDir=/safps03/SalesFinance$/ABY;DriverId=25;FIL=MS Access;MaxBufferSize=2048;PageTimeout=5;

Then:

Code:
ActiveCell.PivotTable.PivotCache.Connection = "Database;DBQ=//safps03/SalesFinance$/ABY/db1.mdb;DefaultDir=/safps03/SalesFinance$/ABY;DriverId=25;FIL=MS Access;MaxBufferSize=2048;PageTimeout=5;"

Note the quotes around the connection string and the use of forward slashes instead backslashes.
 
Upvote 0
I am still having problems. I am going to practice changing technique to my C: drive. to make sure I am doing that part right before bothering you again.
Should I be able to Change the T to C as long as I have copy of folder on my C: Drive.

I am really sorry for bothering you so many times.
 
Upvote 0
Hey I got it to work.
Thanks so much.

I am going to search or post another question but I figure your just going to have answered it or answer it.
Am I better size of file chosing where I house the pivottable data?

Again Thanks the stuff you know is amazing.
 
Upvote 0

Forum statistics

Threads
1,214,389
Messages
6,119,232
Members
448,879
Latest member
VanGirl

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