Skip to Content
0

AutoRefresh excel data (Through SAP BO Analysis)

Feb 07, 2017 at 11:12 AM

195

avatar image

Hi,

I have an excel sheet with data loaded through SAP BO (Analysis plugin). Everytime I open the sheet, I need to choose the prompt and then manually click on refresh to get the latest data (although the autorefresh on opening the file toggle is selected).

My question though, is how can I set it to automatically refresh the data at a set interval after I opened the file ? Can I add any VBA code to do that ? If so, can you share what code to use ?( Note that I have hardly any skills in coding, so I can only copy/paste the code you share with me :) )

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Tammy Powlas
Feb 07, 2017 at 11:13 AM
0

Hi - a quick search shows contributor Martin Kreitlin's blog here: https://blogs.sap.com/2015/09/09/best-practices-for-vba-in-sap-bi-analysis-for-ms-excel/ - please review it to see if helps

Share
10 |10000 characters needed characters left characters exceeded
Waseem A Feb 09, 2017 at 07:47 AM
0

Thanks Tammy, but unforutnately it's not clear enough for me.

Show 1 Share
10 |10000 characters needed characters left characters exceeded
0
Steffen Haas Feb 09, 2017 at 01:52 PM
0

Hi,

this VBA Code works fine for me. After a double click on the workbook which is saved on my desktop, the AO Add-In starts and the datasource refresh automatically.

Sub EnableAnalysisOffice()

Dim addin As COMAddIn

For Each addin In Application.COMAddIns

If addin.progID = "SapExcelAddIn" Then

If addin.Connect = False Then addin.Connect = True

End If

Next

End Sub


Sub BWLogon()

Dim lResult As Long

lResult = Application.Run("SAPLogon", "Your Datasource, for example DS_1", "Your Mandant", "Your User", "Your Password", "Your Language")

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

End Sub


Sub Workbook_open()

Call EnableAnalysisOffice End Sub


Sub Workbook_SAP_Initialize()

Call BWLogon

End Sub

I use AO 2.3.3

Best Steffen

Share
10 |10000 characters needed characters left characters exceeded