Also, if it is easier, I will sacrifice the versatility of switching back and forth to just being able to run it to switch it to Postgres.
Thanks again for all your help (and patience).
Skip,
It just gives me a bland error message with the option to run the debug console. In the console, it just highlights the offending line in yellow ---> .Connection = sConn(WhichWay - 1)
I am guessing it is having a problem doing the calculation...In the code, does the datatype for...
Skip,
I think we are getting close. :)
I ran the above but it errored on the following line:
.Connection = sConn(WhichWay - 1)
I couldnt figure out what it didnt like. It was executed entering 1 for the choice which should have defaulted to an sConn(0).
Also, if this works, I will remove...
Skip,
So if I have a workbook with several different pivots that point to the original connection, I will need to run this for each pivot table or once for the entire workbook?
Also, how do I modify my original Sub ChangeServer()with the Sub you provided? (Sorry for a dumb question but my...
Skip,
Thanks..I will try this. I do have some really basic questions about the solution...
I just need to run this with the new ODBC connection information and do not need to specify changing this in the instances where the old connection is present?
Also, for this file, there is only one...
I was able to record this from the Macro recorder...Now how do I use it???
With ActiveWorkbook.PivotCaches.Add(SourceType:=xlExternal)
.Connection = Array(Array( _...
Here are the two ODBC connections.
This is the current ODBC connection that needs to be changed:
DSN=Oracle_PROD;UID=JSMITH;; AUTHENTICATION=;AUTHENTICATONPARAMETER=;
Below is the desired ODBC connection that needs to replace the original one listed above...
Skip,
Loved the simple approach to solving this but when I tried to do this, after I complete the File > return data to Excel step, it will not let me stop the macro recording without clicking finish for the wizard. When Finish is clicked, it retrieves the data then issues a message of "unable...
The vb can be found above. I am trying to change this to a postgres database (i.e. NOT Teradata).
I am fairly certain that it does not contain enough parameters for the Postgres ODBC connection; so any help is appreciated.
Sub ChangeServer()
Dim ptc As PivotCache, oldSrv As String, newSrv As String
'Request the name of the old server/file name.
oldSrv = "Oracle_Prod"
'Request the name of the new server/file name.
newSrv = "Teradata_Prod"
'Replace the ODBC information of whatever PivotTable is currently active...
Hi everyone...
I need to write a VB procedure for an Excel PivotTable that will change its cached ODBC connection to a new Postgres ODBC connection.
I have part of the procedure written but I get an error when it is switched to the Postgres ODBC connection. My guess is that some of the...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.