Might be easier to just query the table from excel as the data source when you create the pivot table, I find managing pivot tables in excel much, much easier.
*EDIT: Ensure you set your connection to "Share Deny None" to avoid locking your db!
User Profile
Collapse
-
-
Is there a specific reason it has to be VBA code? You can simply set up a macro to export the files for you, no VBA needed. Would you like more information on this?Leave a comment:
-
You need to add a WHERE clause to your query, the sytanx would be as follows:
Code:SELECT (fields you want to select) FROM (source table) INNER JOIN ON (the other table you are joining with) WHERE (desired field) = (desired value for the field) ;
Leave a comment:
-
@NeoPa sorry about that was my first time actively taking part in this sub!
If it confuses anyone else why Excel would want to lock a file even when it is not being actively used (in this case, from a refresh point until the workbook is closed) I have found a way to ensure this does not happen. Now for me this was not an option as mentioned.
There are multiple way to select data sources for a pivot table in Excel. ...Last edited by zmbd; Dec 19 '13, 08:53 PM. Reason: [pegicity:For clarity][z{formatted the code blocks some}]Leave a comment:
-
Thankfully as this is just a reporting unit, the tables never get above 200 or 300K records as opposed to our SAP database that tracks actual transactions which gets to millions easily. So it might take 10 or 15 seconds, but seeing as it is better than tracking down a few hundred or so reports and trying to enforce a new connection precdure, I will take it.Leave a comment:
-
UPDATE:
I found that by using a holding database that is simply a mirror of the master file (but all tables are smiply linked tables to the master file) I can freely update the source, which in turn updates the linked database holding file which is now the database that excel locks. Sure it is bush league, but it works!
Thanks to everyone who took the time to take a look. Yes I know this is a terrible way to run things...Leave a comment:
-
Thanks for helping me out everyone, unforetunetly Zmbd's answer (while correct) isn't exactly what I was looking for.
Let me re-describe the situation. I am in the reporting unit for a company, my entry level job is to maintain a series (few dozen) of databases that the financial managers point to with excel pivot tables (to use Cognos or a similar SAP product would cost millions to set up and maintain, and the company doesn't find...Leave a comment:
-
Trying to copy and overwrite a file
Having issues of users leaving excel workbooks that contain pivot tables linked to a db open, users are located all over the region so it is not as simple as walking around the office asking everyone to close out their files. I am trying to write a sub to copy and paste the newest version of my db over the old even while there are active connections, is there any way to force this? Currently my code is a simple
...Code:FileCopy "S:\path\x.mdb",
No activity results to display
Show More
Leave a comment: