on 2022 Jul 12 9:01 AM
Request clarification before answering.
Just checked the code
Public Sub ChangeCon()
Dim epm As New FPMXLClient.EPMAddInAutomation
Dim strConn As String
Dim strServer As String
Dim strEnvironment As String
Dim strModel As String
strServer = "http://XXXXXXXXXXX:8080/sap/bpc/"
strEnvironment = "XXXXXX"
strModel = "Consolidation" '"PLANNING_PER"
strConn = "_FPM_BPCNW10_[" & strServer & "]_[" & strEnvironment & _
"]_[" & strModel & "]"
epm.ChangeReportConnection ThisWorkbook.ActiveSheet, "000", strConn
End Sub
Working fine, no errors
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
To ensure that proper connection is selected you can create a VBA code to:
1. Disconnect
2. Connect to particular server+environment+model (using server username and password)
I have created Excel Add-In to quickly switch between multiple connections. When I am using this VBA tool my report and data connections are always in sync.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Vadim,
I find a API "ChangeReportConnection" and write below VBA to change the report conn.
However it always failed with error, and told me a syntax error with bpc.ChangeReportConnection(ws,"000",StrConn)
Dim bpc As New EPMAddInAutomation
Sub refresh_Click()
Dim StrConn As String
Dim ws As Worksheet
Set ws = ActiveSheet
StrConn = "_FPM_BPCNW10_[http://192.168.7.159/sap/bpc/]_[SUNACBPC]_[PLANNING]"
bpc.ChangeReportConnection(ws,"000",StrConn)
End Sub
Please help to check and give me some advice on how to revise this. thanks.
hailongjin
"every end user can use to switch the report Model conn" - strange idea! What is the business case?
Do you have identical models in production environment?
Why user need to switch report connection?
P.S. By the way, there is also:
SetActiveDataManagerConnection(string connectionString)
hailongjin Hello,
Please make sure Your report/Input form is not set to store connection and Environment details. Goto Edit Report > Options and make sure these below options are checked. Once the report is saved with these options set, next time it should automatically switch the connection.
Please Upvote and Accept if the answer helps you.
Regards
Nikhil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hailongjin,
I tested it in my landscape with below steps.
I save my report on server as well as local desktop.
I log off from my Dev system and log on to QA system and open the report from my desktop. Report is connected to QA system.
Please try these steps and see if it works for you.
Regards
Nikhil
User | Count |
---|---|
6 | |
4 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.