cancel
Showing results for 
Search instead for 
Did you mean: 

How to suppress the login dialog box in VBA for AO

Former Member
0 Kudos

Hello!

Does anyone know how to suppress the prompt for logging on to Business Objects when using VBA? The code already does the trick so the prompt would have to be avoided otherwise it's blocking the rest of the script..

My Code:

Sub LogonToServer()

Dim lResult As Long

Dim MyClient As String

Dim MyUser As String

Dim MyPWD As String

Dim MyLang As String

MyClient = "xxx"

MyUser = "xxx"

MyPWD = "xxx"

MyLang = "EN"

' Log into SAP Analysis for Excel

iAppCall = Application.Run("SAPLogon", "DS_1", MyClient, MyUser, MyPWD, MyLang)

' Refresh the query Analysis -> Refresh All

lResult = Application.Run("SAPExecuteCommand", "Refresh", "DS_1")

End Sub

Accepted Solutions (1)

Accepted Solutions (1)

reyemsaibot
Active Participant

Hi,

have your AO Workbook a flag with the option "Refresh Workbook on Opening"?

When the answer is yes, you have no chance to suppress the dialog via VBA.

regards

Tobias

Former Member
0 Kudos

Hi Tobias, Yes my screen looks exactly like yours. Isn't there any workaround? Cheers Lucien

reyemsaibot
Active Participant
0 Kudos

Hi Lucien,

at your screenshot I see the login to a BO Server. When you only use a BW system, you can set this in your settings. Then the Popup shouldn't appears.

When you choose the option NetWeaver, you can only login to a BW system.

Former Member
0 Kudos

Thanks Tobias, I can select that option but unfortunately nothing changes regarding the behaviour. The login is still there when running the code. Also on saving and reopening the workbook the setting is back on Compatibility mode. Thanks again.

Former Member
0 Kudos

Sorry, I CAN save the option but the system is throwing an error. I need different code for this option. Any help on that would be much appreciated. Cheers.

Former Member
0 Kudos

Hello Lucien,

I use this VBA code for auto logon.

Best regards.

Steffen

Former Member
0 Kudos

Thanks Steffen. What is your platform selection? Your code gives me the same error as before(Object reference not set to an instance of an object).

Former Member
0 Kudos

I use it on BO 2.0.4 and BI 4.1

Answers (1)

Answers (1)

Former Member
0 Kudos

Thanks a lot Tobias and Steffen! Problem solved, with Netweaver as platform all i needed to do was adjust the data source. Thanks again! Lucien

0 Kudos

Hi Lucien! May i ask how did you adjust the data source at last as im having the same problem right now haha. Thank you!!!